otp-services

1.0.6 • Public • Published

otp-services

An OTP generator package for node js.

A highly customizable and easy to use OTP Generator and verifier in Javascript. Just import the package and send your inputs. It will generate the OTP. Written in ES5/ES6 for maximum compatibility.

Install

npm install otp-services

Usage

To generate OTP

let otp_services = require("otp-services");

let otp = otp_services.setNumber(4);  // any digit 4, 6, 8,...


Output: otp 2206

To verify OTP

verifyOTP() sets the expiration time of OTP to your input minutes after the current time. It takes two parameters, dateTime and number of minutes.

let otp_services = require("otp-services");

let time = otp_services.verifyOTP('2023-02-22 15:52:34', 5);

if (time == true) {

    `Verify successfully..!`

} else {

    `OTP expired..!`

}

License

MIT

Dependents (0)

Package Sidebar

Install

npm i otp-services

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

3.65 kB

Total Files

4

Last publish

Collaborators

  • aniketchougule