0.1.0 • Published 3 years ago

ootp v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

OOTP

OOTP (Open One-time Password) is a supports multiple programming languages. The generated one-time passwords are fully compliant with HOTP (HMAC-based One-time Password) and TOTP (Time-based One-time Password). 🚀It's easy to use!

Introduction

The OOTP for Node.js module is a TypeScript implementation of the OOTP library.

Features

  • Generate OOTP passwords for multiple programming languages
  • 100% Open source
  • HOTP
  • TOTP
  • RFC 4226 compliant
  • RFC 6238 compliant

Installation

  • Install via npm: npm install ootp
  • Install via yarn: yarn add ootp

Usage

You can use the library in your TypeScript or JavaScript projects.

💡Tips: You need to install implementation Base32 module for you project.

Example use thirty-two module.

import base32 from 'thirty-two';
import { TOTP } from 'ootp';

const base32_encoded_secret = "MU2TSNRZG5TGKMBYGAZDCMJTMM3GIMJVMZRTINDFGI3WGZRVMQ4Q";
const base32_decoded_secret = base32.decode(base32_encooded_secret);

/// Create a TOTP
const totp = new TOTP({ secret: base32_decoded_secret });

/// Make a OTP code.
const otp = totp.make();

/// Dispaly the OTP code.
console.log(otp);

Examples

Documentation

  • TOTP class
    • make - Generate OTP code
    • check - Check OTP code
  • HOTP class
    • make - Generate OTP code
    • check - Check OTP code

License

The OOTP is licensed under the MIT license.

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago