generatePasswordHash static method
A utility method to generate a password hash using the PBKDF2 scheme.
Implementation
static String generatePasswordHash(String password, String? salt,
{int hashRounds = 1000, int hashLength = 32, Hash? hashFunction}) {
final generator = PBKDF2(hashAlgorithm: hashFunction ?? sha256);
return generator.generateBase64Key(
password, salt ?? '', hashRounds, hashLength);
}