Bip39MnemonicGenerator class

BIP39 Mnemonic Generator for generating mnemonic phrases.

This class provides the functionality to generate BIP39 mnemonic phrases from either the number of words or entropy bytes. It utilizes the Bip39MnemonicEncoder for encoding.

Example usage:

final generator = Bip39MnemonicGenerator(Bip39Languages.english);

// Generate a BIP39 mnemonic phrase from the number of words (e.g., 12 words).
final mnemonic12Words = generator.fromWordsNumber(Bip39WordsNum.wordsNum12);

// Generate a BIP39 mnemonic phrase from entropy bytes.
final entropy = List<int>.from([/* your entropy bytes here */]);
final mnemonicFromEntropy = generator.fromEntropy(entropy);

print("Generated BIP39 mnemonic (12 words): $mnemonic12Words");
print("Generated BIP39 mnemonic from entropy: $mnemonicFromEntropy");

Constructors

Bip39MnemonicGenerator([Bip39Languages language = Bip39Languages.english])
Create a new instance of the BIP39 Mnemonic Generator.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fromEntropy(List<int> entropyBytes) Mnemonic
Generate a BIP39 mnemonic phrase from the provided entropy bytes.
fromWordsNumber(Bip39WordsNum wordsNum) Mnemonic
Generate a BIP39 mnemonic phrase from the specified number of words.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited