Skip to content

Commit

Permalink
Add new mnemonic from entropy fn
Browse files Browse the repository at this point in the history
  • Loading branch information
romeobuilderotti committed Jun 9, 2024
1 parent 912fb7b commit 5087d12
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 5087d12

Please sign in to comment.