Validates a password against a stored hash using the Algorithm 2.B hash.
The password to validate.
The stored key containing the hash (first 32 bytes) and validation salt (bytes 32-40).
Optional
Extra data for owner password validation (user key).
A promise that resolves to the computed hash if validation succeeds.
Error if the password is invalid or salt/hash lengths are incorrect.
try { await validatePasswordHash(password, storedKey) console.log('Password is valid')} catch (e) { console.log('Invalid password')} Copy
try { await validatePasswordHash(password, storedKey) console.log('Password is valid')} catch (e) { console.log('Invalid password')}
Validates a password against a stored hash using the Algorithm 2.B hash.