generate static method
Generates a new mnemonic phrase with the specified entropy strength.
strength must be a multiple of 32 between 128 and 256 bits.
Common values: 128 (12 words), 160 (15 words), 192 (18 words), 224 (21 words), 256 (24 words)
Implementation
static List<String> generate({int strength = 128}) {
if (strength % 32 != 0 || strength < 128 || strength > 256) {
throw ArgumentError(
'Strength must be a multiple of 32 between 128 and 256');
}
final entropyBytes = strength ~/ 8;
final entropy = _generateEntropy(entropyBytes);
return _entropyToMnemonic(entropy);
}