entropy_to_mnemonic

Function entropy_to_mnemonic 

Source
pub fn entropy_to_mnemonic(
    entropy: &[u8],
    language: Option<Language>,
) -> Result<String, DerivationError>
Expand description

Converts entropy bytes to a mnemonic phrase.

§Arguments

  • entropy - The entropy bytes to convert
  • language - Optional language (default: English)

§Returns

  • Result<String, DerivationError> - The mnemonic phrase or an error

§Example

use bitcoin_address_generator::entropy_to_mnemonic;

let entropy = vec![0u8; 16]; // 128 bits
let mnemonic = entropy_to_mnemonic(&entropy, None).unwrap();
assert_eq!(mnemonic.split_whitespace().count(), 12);