password_hash library

Maps libsodium's crypto_pwhash_* api.

Classes

MemLimit
OpsLimit

Properties

bytesMax int
final
bytesMin int
final
storeBytes int
final

Functions

needsRehash(Uint8List hash, int opsLimit, int memLimit) bool
Verifies if a hash generated by store was generated with opsLimit and memLimit. If not a new hash must be generated. Throws an ArgumentError, if the hash is invalid.
store(Uint8List password, int opsLimit, int memLimit) Uint8List
Generates a password hash which can be safely stored. opsLimit must be between OpsLimit.min and OpsLimit.max. memLimit must be between MemLimit.min and MemLimit.max. Throws a PasswordHashException when generating a password hash fails.
verify(Uint8List hash, Uint8List password) bool
Verifies a password with hash generated by store.

Exceptions / Errors

PasswordHashException