UNPKG

random-otp

Version:

'randomtask' is simple one time password generator

12 lines (10 loc) 275 B
module.exports={ generaterandomNumbers:function (l) { var digits = '0123456789'; let OTP = ''; for (let i = 0; i < l; i++ ) { OTP += digits[Math.floor(Math.random() * 10)]; } return OTP; } }