Skip to content

Commit

Permalink
Add new mnemonic from entropy fn (#135)
Browse files Browse the repository at this point in the history
Co-authored-by: poma <semenov.roman@mail.ru>
  • Loading branch information
poma-keeps-building and poma authored Jun 9, 2024
1 parent 912fb7b commit 20b2279
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bip39/src/mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ where
}
}

/// Returns a new mnemonic instantiated from an existing entropy.
pub const fn new_from_entropy(entropy: Entropy) -> Self {
Self {
entropy,
_wordlist: PhantomData,
}
}

/// Returns a new mnemonic given the word count, generated using the provided random number
/// generator.
pub fn new_with_count<R: Rng>(rng: &mut R, count: usize) -> Result<Self, MnemonicError> {
Expand Down

0 comments on commit 20b2279

Please sign in to comment.