Download the PHP package fenguoz/bip39-mnemonic-php without Composer
On this page you can find all versions of the php package fenguoz/bip39-mnemonic-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bip39-mnemonic-php
BIP39 Mnemonic
Mnemonic BIP39 implementation in PHP
Installation
Prerequisite
- PHP ^8.1
- ext-mbstring (MultiByte string PHP ext. for non-english wordlist)
Composer
composer require fenguoz/bip39-mnemonic-php
Mnemonic Object
This lib will create this Mnemonic object as a result:
Prop | Data | Description |
---|---|---|
entropy | string | Hexadecimal representation of binary Entropy bits |
wordsCount | int | Number of words (12, 15,18, 21 or 24) |
wordsIndex | array | Indexed array (of integers) indexes from wordlist |
words | array | Indexed array of mnemonic codes |
rawBinaryChunks | array | Indexed array of binary bits (1s and 0s) each containing 11 bits according to BIP39 Spec |
Generate Mnemonic Codes (12, 15, 18, 21 or 24 words)
Generate mnemonic of 12, 15, 18, 21 or 24 words using an entropy driven from cryptographically secure pseudo-random bytes.
Generate Mnemonic using specified Entropy
Specify your own entropy to generate mnemonic codes:
Reverse (Mnemonic to Entropy)
Use mnemonic codes to find entropy. By default, lib will cross-check checksum therefore not using valid mnemonic codes will throw an exception.
Generate non-english mnemonic codes
Mnemonic codes may be generated in ALL languages supported in BIP39 spec. This example generates 12 mnemonic codes in Spanish language as an example, and it may be replaced with other any other language with wordlists in BIP39 spec, check here.
Test Vectors
- [29-01-2023]: Test vectors mentioned
in official BIP-0039 specification
are tested and included in package. Execute
tests/test_a.php
to re-run following tests.
All versions of bip39-mnemonic-php with dependencies
ext-mbstring Version *