createKeyS(len){
// 字符串可以根据自己的
let arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9','A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',]
let length = parseInt(len);
let code = "";
for(let i = 0;i<length;i++){
code += arr[Math.floor(Math.random() * arr.length)]
}
return code
}
随机指定长度的字符串
最新推荐文章于 2023-11-07 18:11:59 发布