Browser-only TOTP generator. Paste a Base32 secret or an otpauth:// URI and read the current 6-digit code plus the next 30-second window.
Live demo: accstall.com/en/tools/2fa-generator
- Runs in the browser. Parse and generate in JavaScript. The paste is not sent to a backend, logged, or written to
localStorage/sessionStorage/ IndexedDB. - No query-string secrets. On load,
?secret=is deleted withhistory.replaceStateand a one-line warning is shown. Never put a TOTP secret in a shareable link. - SHA1 / 6 / 30 only. Compatible with Google Authenticator, Authy, and RFC 6238 SHA1 authenticators. otpauth URIs that ask for other digits, periods, or algorithms are rejected. A plausible wrong code is worse than no code.
- Clipboard copy prefers
navigator.clipboardand falls back todocument.execCommand('copy').
Open index.html in a browser (file:// works). No build step.
This standalone copy uses the device clock. A wrong OS clock yields wrong codes. The live Accstall page can offset from a server clock (GET /clock → { "t": <unix_ms> }). You can pass { clockUrl: '/clock' } to accstallTotp() if you host that endpoint yourself.
npm test
RFC 4226 HOTP and RFC 6238 TOTP (6-digit) vectors must stay green. Do not tidy the SHA-1 / HMAC bit-twiddling without re-running them. crypto.subtle is intentionally not used so the page still works on plain HTTP / file://.
MIT