0.1.0 • Published 2 years ago

@ascmartins/verification-otp-generator v0.1.0

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

verification-code-generator

Verification OTP Generator is a simple and flexible verification code generator.

Installation

Use npm:

npm install verification-otp-generator

Usage

const otpGen = require('verification-otp-generator')
const allChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYXZ!#$()[]{}-*+&%'
const digits = '01234567890'

let otp1 = otpGen(9, digits)

let otp2 = otpGen(9, allChars)

Output examples

otp1: 452402813

otp2: 2pUFQ!5GF

API

 verification-otp-generator(size, characters)
  • size - the size of the OTP code
  • characters - a string of characters to use to generate the code (it's up to you)

License

verification-otp-generator is licensed under the MIT license