Created
September 15, 2022 09:21
-
-
Save stefanocudini/16bb816b0cb4629287949bacf93c2003 to your computer and use it in GitHub Desktop.
mini random string in nodejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let prevs = []; | |
while(true) { | |
const rnd = Buffer.from((10*Math.random()).toString()).toString('base64').substr(3,20) | |
//NS42MDExOTQwNTEzMjkwMDQ= | |
//console.log(rnd) | |
prevs.push(rnd) | |
let i = prevs.indexOf(rnd); | |
if(i>-1) { | |
prevs[i] += '#' | |
} | |
console.log(prevs.join("\n")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment