API
Links: API, Interfaces, Classes, Functions, Types, Variables
Interfaces
Interface: TOTPOptions
Options for TOTP generation.
export interface TOTPOptions {
digits?: number;
algorithm?: TOTPAlgorithm;
period?: number;
timestamp?: number;
}
See also: TOTPAlgorithm
Links: API, Interfaces, Classes, Functions, Types, Variables
Classes
Class: TOTP
export class TOTP {
static generate(secret: number[], options?: TOTPOptions): string
static validate(secret: number[], passcode: string, options?: TOTPValidateOptions): boolean
}
See also: TOTPOptions, TOTPValidateOptions
Method generate
Generates a Time-based One-Time Password (TOTP).
See also: TOTPOptionsReturns
The generated TOTP.
Argument Details
- secret
- The secret key for TOTP.
- options
- Optional parameters for TOTP.
Method validate
Validates a Time-based One-Time Password (TOTP).
See also: TOTPValidateOptionsReturns
A boolean indicating whether the passcode is valid.
Argument Details
- secret
- The secret key for TOTP.
- passcode
- The passcode to validate.
- options
- Optional parameters for TOTP validation.
Links: API, Interfaces, Classes, Functions, Types, Variables
Functions
Types
TOTPAlgorithm |
TOTPValidateOptions |
Links: API, Interfaces, Classes, Functions, Types, Variables
Type: TOTPAlgorithm
Links: API, Interfaces, Classes, Functions, Types, Variables
Type: TOTPValidateOptions
Options for TOTP validation.
See also: TOTPOptions
Links: API, Interfaces, Classes, Functions, Types, Variables