PHPackages                             fenguoz/bip39-mnemonic-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fenguoz/bip39-mnemonic-php

ActiveLibrary

fenguoz/bip39-mnemonic-php
==========================

BIP39 Mnemonics implementation in PHP

1.2.0(3y ago)227.2k↓10.6%28MITPHPPHP &gt;=8.0

Since Feb 9Pushed 3y agoCompare

[ Source](https://github.com/Fenguoz/bip39-mnemonic-php)[ Packagist](https://packagist.org/packages/fenguoz/bip39-mnemonic-php)[ RSS](/packages/fenguoz-bip39-mnemonic-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (8)

BIP39 Mnemonic
==============

[](#bip39-mnemonic)

Mnemonic BIP39 implementation in PHP

Installation
------------

[](#installation)

### Prerequisite

[](#prerequisite)

- PHP ^8.1
- [ext-mbstring](http://php.net/manual/en/book.mbstring.php) (MultiByte string PHP ext. for non-english wordlist)

### Composer

[](#composer)

`composer require fenguoz/bip39-mnemonic-php`

Mnemonic Object
---------------

[](#mnemonic-object)

This lib will create this Mnemonic object as a result:

PropDataDescriptionentropystringHexadecimal representation of binary Entropy bitswordsCountintNumber of words (12, 15,18, 21 or 24)wordsIndexarrayIndexed array (of integers) indexes from wordlistwordsarrayIndexed array of mnemonic codesrawBinaryChunksarrayIndexed array of binary bits (1s and 0s) each containing 11 bits according to [BIP39 Spec](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki)Generate Mnemonic Codes (12, 15, 18, 21 or 24 words)
----------------------------------------------------

[](#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.

```
