Skip to main content

Function: comparePassword()

comparePassword(plainPassword, storedHash): Promise<boolean>

Defined in: hash.ts:75

Compares a password against a stored hash using a constant-time comparison.

Supports both the versioned pbkdf2-sha256$<iterations>$<salt>$<hash> format and the legacy salt:hash format (1,000 iterations).

Parameters

ParameterType
plainPasswordstring
storedHashstring

Returns

Promise<boolean>