编程语言/阿里云数据库密码生成器
来自康健生活
< 编程语言
标题文字
const a = [...new Array(26)].map((_, i) => String.fromCharCode(65 + i));
const b = [...new Array(26)].map((_, i) => String.fromCharCode(97 + i));
const c = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
const d = '()`~!@#$%^&-+=|{}[]:;<>,.?/'.split('');
const pass = (arr, len) => {
let s = "";
for (let i = 0; i < len; i++) {
s += arr[Math.floor(Math.random() * arr.length)];
}
return s;
};
const random = pass(a.concat(b, c, d), 16);
console.log(random);
uI!AYs}/xH&{Ua9Q
No categories