当前位置:网站首页>Generate random password / verification code
Generate random password / verification code
2022-07-06 16:14:00 【Dream height 1.8 meters】
// len, Random length
const randomAuthorizeCode = (len) => {
// seed, Random range
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 Random selection
for (let i = 0; i < len; i++) {
let t = Math.round(Math.random() * (seed.length - 1));
r += seed[t];
}
return r;
}
边栏推荐
- Penetration test (2) -- penetration test system, target, GoogleHacking, Kali tool
- Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
- “鬼鬼祟祟的”新小行星将在本周安全掠过地球:如何观看
- Openwrt source code generation image
- [exercise-1] (UVA 673) parentheses balance/ balanced brackets (stack)
- Advancedinstaller安装包自定义操作打开文件
- Understand what is a programming language in a popular way
- b站 实时弹幕和历史弹幕 Protobuf 格式解析
- [exercise-5] (UVA 839) not so mobile (balance)
- AcWing:第58场周赛
猜你喜欢
409. Longest palindrome
[exercise-7] crossover answers
Penetration test (8) -- official document of burp Suite Pro
力扣:第81场双周赛
Flask框架配置loguru日志庫
QWidget代码设置样式表探讨
C language is the watershed between low-level and high-level
渗透测试 ( 8 ) --- Burp Suite Pro 官方文档
Codeforces Round #801 (Div. 2)A~C
D - function (HDU - 6546) girls' competition
随机推荐
[exercise-6] (PTA) divide and conquer
JS call camera
AcWing:第58场周赛
(POJ - 3579) median (two points)
[exercise-9] Zombie's Treasury test
Alice and Bob (2021 Niuke summer multi school training camp 1)
图图的学习笔记-进程
[exercise-4] (UVA 11988) broken keyboard = = (linked list)
Luogu P1102 A-B number pair (dichotomy, map, double pointer)
Candy delivery (Mathematics)
New to redis
Maximum product (greedy)
1323. Maximum number of 6 and 9
Truck History
渗透测试 ( 1 ) --- 必备 工具、导航
(POJ - 3258) River hopper (two points)
Auto. Getting started with JS
Programmers, what are your skills in code writing?
TCP's three handshakes and four waves
1013. Divide the array into three parts equal to and