Runtime services supplying subtle and randomBytes
Work factor for new hashes
Hash a secret (password) with a random salt.
The password to hash
Stored string in format pbkdf2$<iterations>$<salt>$<hash>
Reports whether a stored hash was made with fewer iterations than this
hasher is configured for, so the application re-hashes it after the next
successful PasswordHasher.verify — the only moment the
plaintext is available.
A hash at or above the configured count reports false, so lowering the
configuration never downgrades a stored credential.
The stored hash string in pbkdf2$<iterations>$<salt>$<hash> format
true when the hash should be replaced
Verify a secret against a stored hash.
A wrong secret returns false; a stored value that is not a well-formed
pbkdf2$… string throws MalformedPasswordHashError, because
that shape of failure is a programming error (most often reversed
arguments) rather than a failed login.
The stored hash string in pbkdf2$<iterations>$<salt>$<hash> format
The password to verify
true if the secret matches, false otherwise
Password hasher using PBKDF2-SHA256 via Web Crypto.
Example