Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 480 Bytes

README.md

File metadata and controls

15 lines (10 loc) · 480 Bytes

@v19/totp

A simple implementation of the Time-Based One-Time Password Algorithm (TOTP) as specified in RFC 6238.

Usage

import { generateSecret, generateUri } from "@v19/totp";

const secret = await generateSecret();
const uri = generateUri(secret, "user@myservice.com", "My Service");
// => otpauth://totp/My%20Service:user%40myservice.com?secret=JBSWY3DPEHPK3PXP&issuer
const code = await totp(secret);