1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! # bip0039
//!
//! [][actions]
//! [][docs.rs]
//! [][crates.io]
//! [][crates.io]
//! [][crates.io]
//! [][whatrustisit]
//!
//! [actions]: https://github.com/koushiro/rust-bips/actions
//! [docs.rs]: https://docs.rs/bip0039
//! [crates.io]: https://crates.io/crates/bip0039
//! [whatrustisit]: https://www.whatrustisit.com
//!
//! Another Rust implementation of [BIP-0039](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) standard.
//!
//! ## Usage
//!
//! ### Compile-time language selection
//!
//! ```rust
//! use bip0039::{Count, English, Mnemonic};
//!
//! // Generate an English mnemonic with 12 words randomly
//! let mnemonic = <Mnemonic<English>>::generate(Count::Words12);
//! // Or use the default generic type (English).
//! let mnemonic = <Mnemonic>::generate(Count::Words12);
//! println!("phrase: {}", mnemonic.phrase());
//!
//! // Generate the HD wallet seed from the mnemonic and the passphrase.
//! let seed = mnemonic.to_seed("");
//! assert_eq!(seed.len(), 64);
//! println!("seed: {}", const_hex::encode(seed));
//! ```
//!
//! ### Runtime language selection
//!
//! ```rust
//! use bip0039::{AnyLanguage, AnyMnemonic, BuiltInLanguage, Count, English};
//!
//! // Generate an English mnemonic with 12 words randomly
//! let mnemonic = AnyMnemonic::generate(BuiltInLanguage::English, Count::Words12);
//! assert_eq!(mnemonic.language(), AnyLanguage::of::<English>());
//! println!("phrase: {}", mnemonic.phrase());
//!
//! // Generate the HD wallet seed from the mnemonic and the passphrase.
//! let seed = mnemonic.to_seed("");
//! assert_eq!(seed.len(), 64);
//! println!("seed: {}", const_hex::encode(seed));
//! ```
extern crate alloc;
pub use ;