跳到主要内容
简化代码。
来源 链接
戈戈
  • 1公里
  • 15
  • 22

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){返回window.btoa(阵列字符串.来自字符代码(...window.crypto.getRandomValues(新Uint8Array(长度*2))).map(c=>String.fromCharCode(c)).join(“”)).replace(/[+/]/g,“”).substring(0,长度);}console.log(生成UID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){返回window.btoa(阵列.(window.crypto.getRandomValues(新的Uint8Array(长度*2))).map(c=>String.fromCharCode(c)).join(“”)).replace(/[+/]/g,“”).substring(0,长度);}console.log(生成UID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){返回window.btoa(字符串.来自字符代码(...window.crypto.getRandomValues(新Uint8Array(长度*2))).replace(/[+/]/g,“”).substring(0,长度);}console.log(generateUID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

已回滚到有效的版本。
来源 链接
戈戈
  • 1公里
  • 15
  • 22

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){return window.btoa(Array.from(window.crypto.getRandomValues(新的Uint8Array(长度*2))).map(c=>字符串.fromCharCode(c)).join(“”)).replace(/[+/]/g,“”).substring(0,长度);}console.log(生成UID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){return window.btoa(Array.from(window.crypto.getRandomValues(new Uint8Array(length*2))).map(String.fromCharCode).join(“”)).replace(/[+/]/g,“”).substring(0,length);}console.log(生成UID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){return window.btoa(Array.from(window.crypto.getRandomValues(新的Uint8Array(长度*2))).map(c=>字符串.fromCharCode(c)).join(“”)).replace(/[+/]/g,“”).substring(0,长度);}console.log(生成UID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

缩短代码。
来源 链接
戈戈
  • 1公里
  • 15
  • 22

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){return window.btoa(Array.from(window.crypto.getRandomValues(新的Uint8Array(长度*2))).map((b) =>字符串.fromCharCode(b)).join(“”)).replace(/[+/]/g,“”).substring(0,长度);}console.log(生成UID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){return window.btoa(Array.from(window.crypto.getRandomValues(新的Uint8Array(长度*2))).map((b) =>字符串.fromCharCode(b)).join(“”)).replace(/[+/]/g,“”).substring(0,长度);}console.log(生成UID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

生成安全的随机字母数字底座62字符串:

函数生成器UID(长度){return window.btoa(Array.from(window.crypto.getRandomValues(new Uint8Array(length*2))).map(String.fromCharCode).join(“”)).replace(/[+/]/g,“”).substring(0,length);}console.log(生成UID(22));//“yFg3以上v2cE9cKOXd7hHwWp”console.log(生成UID(5));//“YQGzP”

回滚到修订版4
来源 链接
戈戈
  • 1公里
  • 15
  • 22
加载
减少12个字符
来源 链接
戈戈
  • 1公里
  • 15
  • 22
加载
回滚到修订版2
来源 链接
戈戈
  • 1公里
  • 15
  • 22
加载
编辑的正文
来源 链接
马丁
  • 3公里
  • 7
  • 31
  • 59
加载
正文中添加了98个字符
来源 链接
戈戈
  • 1公里
  • 15
  • 22
加载
来源 链接
戈戈
  • 1公里
  • 15
  • 22
加载