@deathmoon/totp-generator
totp-generator lets you generate TOTP tokens from a TOTP key.
This package is based on bellstrand's totp-generator.
How to use
var totp = ; var token = ; console; // prints a 6 digit time base token based on inputed key and time
API
key
(string
): the secret key;opts
(Object
): the options object;opts.time
(number
): the timestamp, defaults toDate.now()
.
Works with these token requirements
- SHA-1
- 30 sec epoch interval
- 6 digit tokens
What do I use this library for?
- E2E tests (where you need to login with 2-factor authentication)