Creates a TOTP object.
Optionalconfig: {Configuration options.
Optionalalgorithm?: stringHMAC hashing algorithm.
Optionaldigits?: numberToken length.
Optionalissuer?: stringAccount provider.
OptionalissuerInLabel?: booleanInclude issuer prefix in label.
Optionallabel?: stringAccount label.
Optionalperiod?: numberToken time-step duration.
Optionalsecret?: string | SecretSecret key.
HMAC hashing algorithm.
Token length.
Account provider.
Include issuer prefix in label.
Account label.
Token time-step duration.
Secret key.
StaticdefaultsDefault configuration.
Calculates the counter. i.e. the number of periods since timestamp 0.
Optionalconfig: { timestamp?: number } = {}Configuration options.
Optionaltimestamp?: numberTimestamp value in milliseconds.
Counter.
Generates a TOTP token.
Optionalconfig: { timestamp?: number } = {}Configuration options.
Optionaltimestamp?: numberTimestamp value in milliseconds.
Token.
Calculates the remaining time in milliseconds until the next token is generated.
Optionalconfig: { timestamp?: number } = {}Configuration options.
Optionaltimestamp?: numberTimestamp value in milliseconds.
counter.
Returns a Google Authenticator key URI.
URI.
Validates a TOTP token.
Configuration options.
Optionaltimestamp?: numberTimestamp value in milliseconds.
Token value.
Optionalwindow?: numberWindow of counter values to test.
Token delta or null if it is not found in the search window, in which case it should be considered invalid.
StaticcounterCalculates the counter. i.e. the number of periods since timestamp 0.
Optionalconfig: { period?: number; timestamp?: number } = {}Configuration options.
Optionalperiod?: numberToken time-step duration.
Optionaltimestamp?: numberTimestamp value in milliseconds.
Counter.
StaticgenerateGenerates a TOTP token.
Configuration options.
Optionalalgorithm?: stringHMAC hashing algorithm.
Optionaldigits?: numberToken length.
Optionalperiod?: numberToken time-step duration.
Secret key.
Optionaltimestamp?: numberTimestamp value in milliseconds.
Token.
StaticremainingCalculates the remaining time in milliseconds until the next token is generated.
Optionalconfig: { period?: number; timestamp?: number } = {}Configuration options.
Optionalperiod?: numberToken time-step duration.
Optionaltimestamp?: numberTimestamp value in milliseconds.
counter.
StaticvalidateValidates a TOTP token.
Configuration options.
Optionalalgorithm?: stringHMAC hashing algorithm.
Optionaldigits?: numberToken length.
Optionalperiod?: numberToken time-step duration.
Secret key.
Optionaltimestamp?: numberTimestamp value in milliseconds.
Token value.
Optionalwindow?: numberWindow of counter values to test.
Token delta or null if it is not found in the search window, in which case it should be considered invalid.
TOTP: Time-Based One-Time Password Algorithm.
See
RFC 6238