Skip to main content

service/password

Api Code Documentation / Exports / service/password

Table of contents

Type Aliases

Functions

Type Aliases

Digest

Ƭ Digest: string

Defined in

src/service/password.ts:6


Input

Ƭ Input: string

Defined in

src/service/password.ts:5

Functions

hashPassword

hashPassword(password): Promise<string>

Create a password hash.

Parameters

NameType
passwordstring

Returns

Promise<string>

Defined in

src/service/password.ts:11


isPasswordMatch

isPasswordMatch(candidatePassword, knownPasswordHash): Promise<boolean>

Validate a given password.

Uses a "constant-time" algorithm to counter timing attacks.

Parameters

NameType
candidatePasswordstring
knownPasswordHashstring

Returns

Promise<boolean>

Defined in

src/service/password.ts:19