编程语言/阿里云数据库密码生成器:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
小 文字替换 -“{{leftrightflex|”替换为“{{Double-columns|”
 
第1行: 第1行:
== 标题文字 ==
== 标题文字 ==
{{leftrightflex|<syntaxhighlight lang="javascript">
{{Double-columns|<syntaxhighlight lang="javascript">
const a = [...new Array(26)].map((_, i) => String.fromCharCode(65 + i));
const a = [...new Array(26)].map((_, i) => String.fromCharCode(65 + i));
const b = [...new Array(26)].map((_, i) => String.fromCharCode(97 + i));
const b = [...new Array(26)].map((_, i) => String.fromCharCode(97 + i));

2026年11月26日 (四) 09:39的最新版本

标题文字

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