chipmunkbot-archive/util/random-username.js
2022-11-13 01:32:35 +00:00

6 lines
261 B
JavaScript

const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_.+'
function randomUsername (length = 16) {
return (new Array(length)).fill().map(() => chars[Math.floor(Math.random() * chars.length)]).join('')
}
module.exports = randomUsername