当前位置:网站首页>生成随机密码/验证码
生成随机密码/验证码
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;
}
边栏推荐
- (POJ - 3579) median (two points)
- Information security - threat detection - Flink broadcast stream broadcaststate dual stream merging application in filtering security logs
- 【练习-9】Zombie’s Treasure Chest
- Codeforces Round #799 (Div. 4)A~H
- Nodejs+vue online fresh flower shop sales information system express+mysql
- D - function (HDU - 6546) girls' competition
- 快速转 TypeScript 指南
- PySide6 信号、槽
- 读取和保存zarr文件
- 栈的经典应用—括号匹配问题
猜你喜欢
Openwrt build Hello ipk
快速转 TypeScript 指南
Basic Q & A of introductory C language
1855. Maximum distance of subscript alignment
渗透测试 ( 4 ) --- Meterpreter 命令详解
[exercise-4] (UVA 11988) broken keyboard = = (linked list)
Suffix expression (greed + thinking)
Determine the Photo Position
【练习-7】Crossword Answers
1529. Minimum number of suffix flips
随机推荐
CEP used by Flink
Penetration test (4) -- detailed explanation of meterpreter command
921. Minimum additions to make parentheses valid
Opencv learning log 26 -- detect circular holes and mark them
【练习-4】(Uva 11988)Broken Keyboard(破损的键盘) ==(链表)
Alice and Bob (2021 Niuke summer multi school training camp 1)
Perform general operations on iptables
【练习-7】Crossword Answers
Nodejs+vue online fresh flower shop sales information system express+mysql
Flag framework configures loguru logstore
Vs2019 initial use
Hdu-6025-prime sequence (girls' competition)
C language must memorize code Encyclopedia
Determine the Photo Position
Sanic异步框架真的这么强吗?实践中找真理
[exercise-5] (UVA 839) not so mobile (balance)
X-forwarded-for details, how to get the client IP
AcWing:第58场周赛
[exercise 4-1] cake distribution
[exercise -10] unread messages