generateDerivedKey method

Uint8List generateDerivedKey()

Implementation

Uint8List generateDerivedKey() {
  var digestBytes = Uint8List(digest.digestSize);

  digest.update(password, 0, password.length);
  digest.update(salt, 0, salt.length);

  digest.doFinal(digestBytes, 0);
  for (var i = 1; i < iterationCount; i++) {
    digest.update(digestBytes, 0, digestBytes.length);
    digest.doFinal(digestBytes, 0);
  }

  return digestBytes;
}