最後活躍 1730364290

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

doracoin 已修改 1730364290. 還原成這個修訂版本

1 file changed, 16 insertions

GenerateInitialPassword.js(檔案已創建)

@@ -0,0 +1,16 @@
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 + })();
上一頁 下一頁