UNPKG

ultrax

Version:

UltraX Package is a unique package that allows you to create cool things using simple functions and make it faster, for example there is an invite logger, discord buttons paginator, etc...

18 lines (16 loc) 505 B
/** * Generates a password * @param {Number} Length The length of the password characters * @returns {Promise<String>} */ function passGen(Length) { if (!Length) throw new TypeError("Length isn't specified") var length = Length, res = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', value = ""; for (var i = 0, n = res.length; i < length; ++i) { value += res.charAt(Math.floor(Math.random() * n)); } return value; } module.exports = passGen;