当前位置:网站首页>生成随机密码/验证码
生成随机密码/验证码
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;
}
边栏推荐
- Truck History
- Common configuration files of SSM framework
- B - Code Party (girls' competition)
- Write web games in C language
- Penetration test (7) -- vulnerability scanning tool Nessus
- Opencv learning log 29 -- gamma correction
- 【练习-8】(Uva 246)10-20-30==模拟
- [exercise-4] (UVA 11988) broken keyboard = = (linked list)
- [exercise-5] (UVA 839) not so mobile (balance)
- Information security - threat detection - detailed design of NAT log access threat detection platform
猜你喜欢

TCP's three handshakes and four waves

Vs2019 initial use

969. Pancake sorting

C language must memorize code Encyclopedia

7-1 understand everything (20 points)

QT实现圆角窗口

滲透測試 ( 1 ) --- 必備 工具、導航

【练习-7】Crossword Answers

Some problems encountered in installing pytorch in windows11 CONDA

Flag framework configures loguru logstore
随机推荐
分享一个在树莓派运行dash应用的实例。
C basic grammar
Sword finger offer II 019 Delete at most one character to get a palindrome
F - birthday cake (Shandong race)
C language is the watershed between low-level and high-level
Essai de pénétration (1) - - outils nécessaires, navigation
409. Longest palindrome
QT实现窗口渐变消失QPropertyAnimation+进度条
socket通讯
b站 實時彈幕和曆史彈幕 Protobuf 格式解析
D - function (HDU - 6546) girls' competition
Opencv learning log 29 -- gamma correction
Shell Scripting
807. Maintain the urban skyline
Nodejs+vue online fresh flower shop sales information system express+mysql
【练习-7】Crossword Answers
What is the difficulty of programming?
Basic Q & A of introductory C language
CEP used by Flink
Pyside6 signal, slot