Skip to content

BeechCMS


BeechCMS / @beechcms/core / IHashProvider

Interface: IHashProvider ​

Methods ​

hash() ​

hash(plaintextPassword): Promise<string>

Hashes a plaintext password using a one-way algorithm so that the original value can never be recovered from the stored digest.

Parameters ​

plaintextPassword ​

string

Returns ​

Promise<string>


verify() ​

verify(plaintextPassword, storedHash): Promise<boolean>

Verifies a plaintext password against a stored hash using a constant-time comparison to prevent timing-based attacks that could reveal whether a hash exists.

Parameters ​

plaintextPassword ​

string

storedHash ​

string

Returns ​

Promise<boolean>