Skip to content

BeechCMS


BeechCMS / @beechcms/core / verifyHashField

Function: verifyHashField() ​

verifyHashField(stored, candidate): Promise<boolean>

Verifies if a candidate string matches a stored SHA-256 hash digest, comparing in constant time.

Parameters ​

stored ​

string

The expected 64-character SHA-256 hex digest.

candidate ​

string

The raw candidate string to verify.

Returns ​

Promise<boolean>

A Promise resolving to true if candidate matches stored digest, false otherwise.