Download the PHP package furqansiddiqui/bip39-mnemonic-php without Composer

On this page you can find all versions of the php package furqansiddiqui/bip39-mnemonic-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bip39-mnemonic-php

BIP39 Mnemonic

Mnemonic BIP39 implementation in PHP

Installation

Prerequisite

Composer

composer require furqansiddiqui/bip39-mnemonic-php

Generating a Secure Mnemonic

Generate a mnemonic using a secure PRNG implementation.

BIP39::fromRandom

Argument Type Description
$wordList AbstractLanguage Langage instance for wordlist
$wordCount int Number of words (12-24)

Returns instance of Mnemonic class.

Example:

Entropy to Mnemonic

Generate mnemonic codes from given entropy

BIP39::fromRandom

Argument Type Description
$entropy AbstractByteArray Entropy
$wordList AbstractLanguage Langage instance for wordlist

Returns instance of Mnemonic class.

Example:

Mnemonic sentence/Words to Mnemonic

Generate entropy from mnemonic codes

BIP39::fromWords

Argument Type Description
$words Array\ Array of mnemonic codes
$wordList AbstractLanguage Langage instance for wordlist
$verifyChecksum bool Defaults to TRUE, computes and verifies checksum as per BIP39 spec.

Returns instance of Mnemonic class.

Example:

Mnemonic Class

readonly class Mnemonic

This lib will create this Mnemonic object as a result:

Property Type Description
language string Language name (as it was passed to constructor of wordlist class)
words Array\ Mnemonic codes
wordsIndex Array\ Position/index # of each mnemonic code corresponding to wordlist used
wordsCount int Number of mnemonic codes (i.e. 12, 15, 18, 21 or 24)
entropy string Entropy in hexadecimal encoding

Generating Seed with Passphrase

Mnemonic->generateSeed

Generates seed from a mnemonic as per BIP39 specifications.

Argument Type Description
$passphrase string Defaults to empty string ("")
$bytes int Number of bytes to return, defaults to 64.

Returns:

Type Description
string Returns computed PBKDF2 hash in RAW BINARY as string

Generate non-english mnemonic codes

Check AbstractLanguage and AbstractLanguageFile classes. English class has all 2048 words pre-loaded instead of reading from a local file every time. To implement other languages or custom set of 2048 words, check ChineseWords.php file in tests directory for example of implementation.

and then use in place of AbstractLanguage where required:

Test Vectors

Include PHPUnit tests for all test vectors mentioned in official BIP-0039 specification. Use following command to execute all tests using phpunit.phar


All versions of bip39-mnemonic-php with dependencies

PHP Build Version
Package Version
Requires php-64bit Version ^8.2
ext-mbstring Version *
charcoal-dev/buffers Version ^0.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package furqansiddiqui/bip39-mnemonic-php contains the following files

Loading the files please wait ....