Function: generateTotp()
ts
function generateTotp(secret, options?): string;Generates the current RFC 6238 time-based one-time password (HMAC-SHA1) for a base32 secret, the same code an authenticator app shows. Uses node:crypto only.
Parameters
| Parameter | Type |
|---|---|
secret | string |
options? | TotpOptions |
Returns
string