编程语言/阿里云数据库密码生成器

来自康健生活
Kangkk​(留言 | 贡献)2026年11月26日 (四) 09:39的版本 (文字替换 -“{{leftrightflex|”替换为“{{Double-columns|”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

标题文字

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