1.0.3 • Published 4 years ago
otp-generators v1.0.3
otp-generator
Generate OTP with specific digits and seeds
Index
Install
npm i otp-generatorsUsage
var newOTP = require('otp-generators')
// or
import newOTP from 'otp-generators';
// For numeric OTP
newOTP.generate(6, { alphabets: false, upperCase: false, specialChar: false });
// For alphanumeric OTP
newOTP.generate(6, { alphabets: true, upperCase: false, specialChar: false });
// For alphanumeric with upperCase
newOTP.generate(6, { alphabets: true, upperCase: true, specialChar: false });
// For alphanumeric with special characters
newOTP.generate(6, { alphabets: true, upperCase: true, specialChar: true });generate(length, options)
Arguments
length- length of password. Optional ifoptionsis optional. default length is 6.options- optionaldigits- Default:truetrue value includes digits in OTPalphabets- Default:truetrue value includes alphabets in OTPupperCase- Default:truetrue value includes uppercase alphabets in OTPspecialChar- Default:truetrue value includes special Characters in OTP
