pbkdfDeriveDigest function

Uint8List pbkdfDeriveDigest(
  1. String mnemonic,
  2. String salt
)

Implementation

Uint8List pbkdfDeriveDigest(String mnemonic, String salt) {
  final toBytesSalt = Uint8List.fromList(utf8.encode(salt));
  final derive = PBKDF2KeyDerivator(HMac(SHA512Digest(), 128));
  derive.reset();
  derive.init(Pbkdf2Parameters(toBytesSalt, 2048, 64));
  return derive.process(Uint8List.fromList(mnemonic.codeUnits));
}