You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Natsuki/util/makeid.js

10 lines
315 B

module.exports = (length) => {
let result = '';
let characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
let charactersLength = characters.length;
let i;
for (i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}