Re-exports from `rand` crate shall be used. Otherwise trait bounds in `Mnemonic::generate_in_with` for `rand::thread_rng` object can get unsatisfied if crate deps get ouf of sync. This commit is fixing following errors: ``` error[E0277]: the trait bound `ThreadRng: rand_core::RngCore` is not satisfied --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:292:30 | 292 | Mnemonic::generate_in_with(&mut rand::thread_rng(), language, word_count) | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::RngCore` is not implemented for `ThreadRng` | | | required by a bound introduced by this call |:: = help: the following other types implement trait `rand_core::RngCore`: ... note: required by a bound in `Mnemonic::generate_in_with` --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:266:6 | 260 | pub fn generate_in_with<R>( | ---------------- required by a bound in this associated function ... 266 | R: rand_core::RngCore + rand_core::CryptoRng, | ^^^^^^^^^^^^^^^^^^ required by this bound in `Mnemonic::generate_in_with` ``` ``` error[E0277]: the trait bound `ThreadRng: rand_core::CryptoRng` is not satisfied --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:292:30 | 292 | Mnemonic::generate_in_with(&mut rand::thread_rng(), language, word_count) | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::CryptoRng` is not implemented for `ThreadRng` | | | required by a bound introduced by this call | = help: the following other types implement trait `rand_core::CryptoRng`: ... note: required by a bound in `Mnemonic::generate_in_with` --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:266:27 | 260 | pub fn generate_in_with<R>( | ---------------- required by a bound in this associated function ... 266 | R: rand_core::RngCore + rand_core::CryptoRng, | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `Mnemonic::generate_in_with` ``` Co-authored-by: Tobin C. Harding <me@tobin.cc> |
||
---|---|---|
.github/workflows | ||
benches | ||
contrib | ||
src | ||
.editorconfig | ||
.gitignore | ||
.rustfmt.toml | ||
CHANGELOG.md | ||
Cargo.toml | ||
LICENSE | ||
README.md |
README.md
bip39
A Rust implementation of BIP-39 mnemonic codes.
Word lists (languages)
We support all languages specified in the BIP-39 standard as of writing.
The English language is always loaded and other languages can be loaded using the corresponding feature.
Use the all-languages
feature to enable all languages.
- English (always enabled)
- Simplified Chinese (
chinese-simplified
) - Traditional Chinese (
chinese-traditional
) - Czech (
czech
) - French (
french
) - Italian (
italian
) - Japanese (
japanese
) - Korean (
korean
) - Portuguese (
portuguese
) - Spanish (
spanish
)
MSRV
This crate supports Rust v1.41.1 and up and works with no_std
.
When using older version of Rust, you might have to pin the version of the
bitcoin_hashes
crate used as such:
$ cargo update --package "bitcoin_hashes" --precise "0.12.0"
If you enable the zeroize
feature the MSRV becomes 1.51.