Skip to content

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

License

Notifications You must be signed in to change notification settings

BinaryBand/one-time-password

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published