function createRandom(len = 32) {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let str = ''
for (let i = 0; i < len; i++) {
str += chars.charAt(Math.floor(Math.random() * chars.length))
}
return str;
}
网友评论