Crate bip0039[][src]

Expand description

Another Rust implementation of BIP-0039 standard.

Usage

use bip0039::{Count, Language, Mnemonic};

/// Generates an English mnemonic with 12 words randomly
let mnemonic = Mnemonic::generate(Count::Words12);

/// Gets the phrase
let phrase = mnemonic.phrase();
println!("phrase: {}", phrase);

/// Generates the HD wallet seed from the mnemonic and the passphrase.
let seed = mnemonic.to_seed("");
println!("seed: {}", hex::encode(&seed[..]));

/// Generates a Simplified Chinese mnemonic with 12 words randomly
let mnemonic = Mnemonic::generate_in(Language::SimplifiedChinese, Count::Words12);
println!("phrase: {}", mnemonic.phrase());

Structs

A mnemonic representation.

Enums

Determines the words count that will be present in a Mnemonic phrase.

The BIP-0039 error.

Language to be used for the mnemonic phrase.