Skip to content

A Time-Based (RFC 6238) and HMAC-Based (RFC 4226) One-Time Password Algorithm Implementation in TypeScript. Used by Ordent project I maintain.

License

Notifications You must be signed in to change notification settings

deanrih/totp-ts

Repository files navigation

@deanrih/totp-ts

A Time-Based (RFC 6238) and HMAC-Based (RFC 4226) One-Time Password Algorithm Implementation in TypeScript. Used by Ordent project I maintain.

Installation

NOTE: The package/library hasn't been actually published yet, these commands are placeholder

# Bun
bun add @deanrih/totp-ts
# pnpm
pnpm add @deanrih/totp-ts
# npm
npm install @deanrih/totp-ts

Usage

NOTE: The package/library hasn't been actually published yet, this example is a placeholder

import { generateTOTP } from "@deanrih/totp-ts";

const code = generateTOTP("secret-key");

console.log(`Your One-Time Password: [${code}]`);

Checkout the example folder.

Credits/Reference

IETF RFC Datatracker

About

A Time-Based (RFC 6238) and HMAC-Based (RFC 4226) One-Time Password Algorithm Implementation in TypeScript. Used by Ordent project I maintain.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published