PHPackages                             xiaohuasheng0x1/bip39-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. xiaohuasheng0x1/bip39-php

ActiveLibrary

xiaohuasheng0x1/bip39-php
=========================

BIP39 Mnemonics implementation in PHP

1.0.0(3y ago)036MITPHPPHP &gt;=8.0

Since Mar 27Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

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 xiaohuasheng0x1/bip39-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.

```
