fuel_crypto/
mnemonic.rs

1#![cfg(all(feature = "std", feature = "random"))]
2
3use crate::Error;
4use coins_bip39::{
5    English,
6    Mnemonic,
7};
8use rand::Rng;
9
10/// Generates a random mnemonic phrase given a random number generator and
11/// the number of words to generate, `count`.
12pub fn generate_mnemonic_phrase<R: Rng>(
13    rng: &mut R,
14    count: usize,
15) -> Result<String, Error> {
16    Ok(Mnemonic::<English>::new_with_count(rng, count)?.to_phrase())
17}