🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

one-time-password

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

one-time-password

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

0.1.6
latest
npm
Version published
Weekly downloads
450
20.32%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • Creative Commons - Used to choose the license

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.

Keywords

security

FAQs

Package last updated on 22 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts