Documentation / @zerotal/auth / hashToken
Function: hashToken()
hashToken(
plaintext):Promise<string>
Defined in: auth/src/PersonalAccessToken.ts:70
Hash a plain-text token using SHA-256 (shared sha256Hex helper) — the same
transform applied at issue time and at verification time, so a presented bearer
value can be matched against the stored hash.
Parameters
plaintext
string
The raw token as presented by (or returned to) the client.
Returns
Promise<string>
The SHA-256 hex digest stored in the token column.
Remarks
Stays async for backward compatibility with existing callers, though
the underlying sha256Hex is synchronous.