2.0.2 • Published 2 years ago

@nibyou/bip39 v2.0.2

Weekly downloads
-
License
CC-BY-SA-4.0
Repository
github
Last release
2 years ago

@nibyou/bip39

From the Bitcoin Improvement Proposal 39 (https://en.bitcoin.it/wiki/BIP_0039) (bitcoin/bips)

Mnemonic lists, basically a collection of 2048 nouns in different languages in an array.

In Bitcoin, lists like these are used to generate IDs for Wallets that humans can more easily remember than just a bunch of numbers. At Nibyou, we use the BIP-39 representation of random bytes to generate recovery passwords in human readable form (example below)

The following languages are currently supported:

LanguageLanguage Code
Germande_DE
Englishen_US
Spanishes_ES
Frenchfr_FR
Italianit_IT
Japaneseja_JP
Koreanko_KP
Portugesept_PT
Simplified Chinesezh_CN
Traditional Chinesezh_TW

Installation

Install the package with npm

$ npm i --save @nibyou/bip39

or with yarn

$ yarn add @nibyou/bip39

Note that the generateMnemonic() function only works in browser contexts (i.e. where window.crypto.getRandomValues() is available).

Usage

Import/Require it in you code:

const bip39 = require("@nibyou/bip39");
// or in typescript
import bip39 from "@nibyou/bip39"

And finally, generate the mnemonic:

let mnemonic = bip39.generateMnemonic(bip39.LANGUAGES.de_DE, 6, '-');
// => 'zylinder-altertum-gitarre-roggen-asteroid-eiszeit'

License

CC-BY-SA-4.0

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago