Skip to content
/ hotp Public

HMAC-Based One-Time Password (HOTP) generation

License

Notifications You must be signed in to change notification settings

v19-io/hotp

Repository files navigation

@v19/hotp

A simple implementation of the HMAC-Based One-Time Password Algorithm (HOTP) as specified in RFC 4226.

Usage

import { generateKey, hotp } from "@v19/hotp";

const key = await generateKey(128); // Generate a 128-bit key
const otp = await hotp(key, 0, 6); // Generate a 6-digit OTP for counter 0