Последняя активность 1730364290

按照固定前缀批量生成随机用户密码,一般涉及到运维场景,给用户账号批量分配默认密码的情况

Версия c06a217f048fa34279a2ca36e05026f0b42e078c

GenerateInitialPassword.js Исходник
1(function () {
2 let prefix = 'PassWord@!.'
3 let max = 9999
4 let printTimes = 30
5
6 for (let i = 0; i < printTimes; i++) {
7 let index = i + 1 < 10 ? `0${i + 1}` : `${i + 1}`
8 let random = Math.round(Math.random() * max + 999)
9 if (random > max) {
10 // console.log("leaked random", random)
11 random -= Math.round(random - max + Math.random() * 999)
12 // console.log("fixed random", random)
13 }
14 console.log(index, prefix + random)
15 }
16})();