@oslojs/otp
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@oslojs/otp

Documentation: https://otp.oslojs.dev

A JavaScript library for generating and verifying OTPs by Oslo.

Supports HMAC-based one-time passwords (HOTP) and time-based one-time passwords (TOTP) as defined in RFC 4226 and RFC 6238.

  • Runtime-agnostic
  • No third-party dependencies
  • Fully typed
import { generateTOTP, verifyTOTP } from "@oslojs/otp";

const totp = generateTOTP(key, 30, 6);
const valid = verifyTOTP(totp, key, 30, 6);

Installation

npm i @oslojs/otp

Readme

Keywords

Package Sidebar

Install

npm i @oslojs/otp

Weekly Downloads

8,995

Version

1.1.0

License

MIT

Unpacked Size

7.77 kB

Total Files

9

Last publish

Collaborators

  • pilcrowonpaper