当前位置:网站首页>生成随机密码/验证码
生成随机密码/验证码
2022-07-06 09:28:00 【梦想身高1米8】
// len,随机长度
const randomAuthorizeCode = (len) => {
// seed,随机范围
var seed = ['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', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
let r = ''
// random随机选中
for (let i = 0; i < len; i++) {
let t = Math.round(Math.random() * (seed.length - 1));
r += seed[t];
}
return r;
}
边栏推荐
- 921. Minimum additions to make parentheses valid
- Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
- CEP used by Flink
- (POJ - 3685) matrix (two sets and two parts)
- b站 实时弹幕和历史弹幕 Protobuf 格式解析
- 滲透測試 ( 1 ) --- 必備 工具、導航
- 树莓派4B64位系统安装miniconda(折腾了几天终于解决)
- 分享一个在树莓派运行dash应用的实例。
- Differential (one-dimensional, two-dimensional, three-dimensional) Blue Bridge Cup three body attack
- 1323. Maximum number of 6 and 9
猜你喜欢
Data storage in memory & loading into memory to make the program run
Pyside6 signal, slot
QT实现圆角窗口
605. Planting flowers
QT按钮点击切换QLineEdit焦点(含代码)
渗透测试 ( 5 ) --- 扫描之王 nmap、渗透测试工具实战技巧合集
快速转 TypeScript 指南
D - function (HDU - 6546) girls' competition
Radar equipment (greedy)
Nodejs+vue online fresh flower shop sales information system express+mysql
随机推荐
[exercise-6] (UVA 725) division = = violence
Opencv learning log 26 -- detect circular holes and mark them
Problem - 922D、Robot Vacuum Cleaner - Codeforces
b站 实时弹幕和历史弹幕 Protobuf 格式解析
图图的学习笔记-进程
2078. Two houses with different colors and the farthest distance
If you want to apply for a programmer, your resume should be written like this [essence summary]
PySide6 信号、槽
AcWing:第58场周赛
Penetration test (1) -- necessary tools, navigation
Write web games in C language
Shell Scripting
C language learning notes
【练习-5】(Uva 839)Not so Mobile(天平)
【练习-7】Crossword Answers
Gartner: five suggestions on best practices for zero trust network access
【练习-1】(Uva 673) Parentheses Balance/平衡的括号 (栈stack)
树莓派4B安装opencv3.4.0
Pytorch extract skeleton (differentiable)
1855. Maximum distance of subscript alignment