From 20b227931bd531cec9032145a300f4b2835861d1 Mon Sep 17 00:00:00 2001 From: poma Date: Sun, 9 Jun 2024 21:29:23 +0300 Subject: [PATCH] Add new mnemonic from entropy fn (#135) Co-authored-by: poma --- bip39/src/mnemonic.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bip39/src/mnemonic.rs b/bip39/src/mnemonic.rs index ee2b4de4..2043b26d 100644 --- a/bip39/src/mnemonic.rs +++ b/bip39/src/mnemonic.rs @@ -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(rng: &mut R, count: usize) -> Result {