当前位置:网站首页>生成随机密码/验证码
生成随机密码/验证码
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;
}
边栏推荐
- The "sneaky" new asteroid will pass the earth safely this week: how to watch it
- Information security - threat detection - Flink broadcast stream broadcaststate dual stream merging application in filtering security logs
- X-forwarded-for details, how to get the client IP
- 【练习-8】(Uva 246)10-20-30==模拟
- 969. Pancake sorting
- Flask框架配置loguru日志庫
- 渗透测试 ( 5 ) --- 扫描之王 nmap、渗透测试工具实战技巧合集
- Sword finger offer II 019 Delete at most one character to get a palindrome
- 【练习-2】(Uva 712) S-Trees (S树)
- QT实现圆角窗口
猜你喜欢
628. Maximum product of three numbers
Advancedinstaller安装包自定义操作打开文件
快速转 TypeScript 指南
Ball Dropping
PySide6 信号、槽
Penetration test (4) -- detailed explanation of meterpreter command
Codeforces Round #802(Div. 2)A~D
QT有关QCobobox控件的样式设置(圆角、下拉框,向上展开、可编辑、内部布局等)
Penetration test (7) -- vulnerability scanning tool Nessus
1013. Divide the array into three parts equal to and
随机推荐
[exercise-3] (UVA 442) matrix chain multiplication
Gartner: five suggestions on best practices for zero trust network access
1903. Maximum odd number in string
Opencv learning log 29 -- gamma correction
Sanic异步框架真的这么强吗?实践中找真理
【练习-2】(Uva 712) S-Trees (S树)
Raspberry pie csi/usb camera uses mjpg to realize web camera monitoring
Luogu P1102 A-B number pair (dichotomy, map, double pointer)
AcWing:第56场周赛
1013. Divide the array into three parts equal to and
[exercise-5] (UVA 839) not so mobile (balance)
E. Breaking the Wall
Sword finger offer II 019 Delete at most one character to get a palindrome
Basic Q & A of introductory C language
第 300 场周赛 - 力扣(LeetCode)
CEP used by Flink
QT实现窗口渐变消失QPropertyAnimation+进度条
807. Maintain the urban skyline
Flag framework configures loguru logstore
C language must memorize code Encyclopedia