totp-gen
A TOTP secret, token generator and verifier!
Installation
npm install --save totp-gen
How to use!
let totp = ; /* Generate a secret BASE32 String */let secretLength = 40;let secret = totp; let time = Date;let periodInSecond = 30;let lengthOfPin = 6; /* Generate a TOTP Token using SECRET, time, period and length. */let totpToken = totp; let company = "MyExampleCompany";let email = "abc@xyz.com"; /* Generate totp URL for authenticator apps*/let totpURL = totp; /* Verify generated token and secret */iftotp console else throw "INVALID_TOKEN_VERIFICATION";