one-time-password
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

One-Time Password

A simple library for deriving one-time passwords from a base32 key.

Getting Started

These instructions will give you a copy of the project up and running on your local machine for development and testing purposes.

Installing

Requirements:

  • Node.js
  • NPM (Node.js package manager)

Install with:

npm install one-time-password

How To Use

import * as OTP from 'one-time-password';

// A base32-encoded key.
const dummyKey: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';

// Derive a 6-digit, time-based token from 'dummyKey'.
const token: string = OTP.generate(dummyKey);

// If token is valid.
console.log(OTP.verify(dummyKey, token));

Built With

Versioning

We use Semantic Versioning for versioning.

Authors

  • Billie Thompson - Provided README Template - PurpleBooth
  • Shane Davenport - Library Author - Github

License

This project is licensed under the MIT License Creative Commons License - see the LICENSE.md file for details.

Dependencies (3)

Dev Dependencies (5)

Package Sidebar

Install

npm i one-time-password

Weekly Downloads

124

Version

0.1.6

License

MIT

Unpacked Size

22.2 kB

Total Files

14

Last publish

Collaborators

  • binary-band