[**Documentation**](../../../README)

***

[Documentation](../../../README) / [zerotal](../../README) / [auth](../README) / hashToken

# Function: hashToken()

> **hashToken**(`plaintext`): `Promise`\<`string`\>

Defined in: [packages/auth/src/PersonalAccessToken.ts:70](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/auth/src/PersonalAccessToken.ts#L70)

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.
