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
//!
//! This is a Rust implementation of the [bip39][bip39-standard] standard for Bitcoin HD wallet
//! mnemonic phrases.
//!
//!
//! [bip39-standard]: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
//!
//! ## Quickstart
//!
//! ```rust
//! use bip39::{Mnemonic, MnemonicType, Language, Seed};
//!
//! /// determines the number of words in the mnemonic phrase
//! let mnemonic_type = MnemonicType::Type12Words;
//!
//! /// create a new randomly generated mnemonic phrase
//! let mnemonic = match Mnemonic::new(mnemonic_type, Language::English, "") {
//! Ok(b) => b,
//! Err(e) => { println!("e: {}", e); return }
//! };
//!
//! /// get the phrase as a string
//! let phrase = mnemonic.get_string();
//! println!("phrase: {}", phrase);
//!
//! /// get the HD wallet seed
//! let seed = mnemonic.get_seed();
//!
//! // get the HD wallet seed as raw bytes
//! let seed_bytes: &[u8] = seed.as_ref();
//!
//! // get the HD wallet seed as a hex string
//! let seed_hex: &str = seed.as_hex();
//!
//! // get an owned Seed instance
//! let owned_seed: Seed = seed.to_owned();
//!
//! ```
//!
extern crate error_chain;
extern crate lazy_static;
extern crate data_encoding;
extern crate bitreader;
extern crate bit_vec;
extern crate ring;
pub use Language;
pub use Mnemonic;
pub use MnemonicType;
pub use Seed;
pub use Error;