Last active
October 17, 2023 05:52
-
-
Save FlameWolf/5afd912d4908c2c84d1865ae2befe290 to your computer and use it in GitHub Desktop.
Generate random ID string V2
This file contains 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
const getRandomIdString = (steps = 4) => { | |
let seed = ""; | |
for (let i = 0; i < steps; i++) { | |
seed += Math.random().toString().substring(2); | |
} | |
return BigInt(seed).toString(36).toUpperCase(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment