Creates a TOTP object.
Optional
config: {Configuration options.
Optional
algorithm?: stringHMAC hashing algorithm.
Optional
digits?: numberToken length.
Optional
issuer?: stringAccount provider.
Optional
issuerInLabel?: booleanInclude issuer prefix in label.
Optional
label?: stringAccount label.
Optional
period?: numberToken time-step duration.
Optional
secret?: string | SecretSecret key.
HMAC hashing algorithm.
Token length.
Account provider.
Include issuer prefix in label.
Account label.
Token time-step duration.
Secret key.
Static
defaultsDefault configuration.
Static
generateGenerates a TOTP token.
Configuration options.
Optional
algorithm?: stringHMAC hashing algorithm.
Optional
digits?: numberToken length.
Optional
period?: numberToken time-step duration.
Secret key.
Optional
timestamp?: numberTimestamp value in milliseconds.
Token.
Static
validateValidates a TOTP token.
Configuration options.
Optional
algorithm?: stringHMAC hashing algorithm.
Optional
digits?: numberToken length.
Optional
period?: numberToken time-step duration.
Secret key.
Optional
timestamp?: numberTimestamp value in milliseconds.
Token value.
Optional
window?: 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