generate method

List<int> generate([
  1. String passphrase = ""
])

Generates a seed from the Bip39 mnemonic.

Optionally, a passphrase can be provided to further secure the seed generation.

Example usage:

final seedGenerator = Bip39SeedGenerator(mnemonic);
final seed = seedGenerator.generate("my_passphrase");

Implementation

List<int> generate([String passphrase = ""]) {
  final salt = Bip39SeedGeneratorConst.seedSaltMod + passphrase;
  return QuickCrypto.pbkdf2DeriveKey(
    password: StringUtils.encode(mnemonic.toStr()),
    salt: StringUtils.encode(salt),
    iterations: Bip39SeedGeneratorConst.seedPbkdf2Rounds,
  );
}