doracoin 修订了这个 Gist . 跳至此修订
1 file changed, 16 insertions
GenerateInitialPassword.js(file created)
| @@ -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 | + | })(); | |
更新
更早