doxadoxa/restore-phrase-generator

Restore phrase generator for passwords inspired by BIP-39 from Bitcoin Core.

dev-master 2020-01-22 11:13 UTC

This package is auto-updated.

Last update: 2024-04-22 21:00:56 UTC


README

Total Downloads Latest Stable Version License

Small PHP library for generating a phrase for password restoring.

Inspired by BIP-39 from Bitcoin Core.

How to install

Just use Composer:

composer require doxadoxa/restore-phrase-generator

How to use

Simply you can work with library via facade-helper-singleton:

use Doxadoxa\Phrase;
$phrase = Phrase::generate("123456");
// about basket book speak plug
$restore = Phrase::decode( $phrase );
// 123456

Or if you have to be more flexible, you can use Generator class instead:

use Doxadoxa\Generator\Generator;
$generator = new Generator("wordlist.txt");
$result = $generator->generate("123456");
// about basket book speak plug
$generator->decode( $result );
// 123456 

You allow to make you own wordlist in file (separated with \n) and provide path to file in Generator constructor.