Last active
December 24, 2019 14:37
-
-
Save derjp/29e3258dd920427aaa80d18251cac97b to your computer and use it in GitHub Desktop.
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 START_STRING = 'nwlIw6fcI6qf1pmTPuZV1c5SdaIEY2P2Jf9Hf50'; | |
const CHARS_TO_GENERATE = 9; | |
const CODES_TO_GENERATE = 100; | |
const POSSIBLE_CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; | |
const TEXTAREA = document.createElement('textarea'); | |
TEXTAREA.cols = 150; | |
TEXTAREA.rows = 100; | |
document.body.appendChild(TEXTAREA); | |
for (let i = 0; i < CODES_TO_GENERATE; i++) { | |
let code = START_STRING; | |
for (let i = 0; i < CHARS_TO_GENERATE; i++) { | |
code += POSSIBLE_CHARS.charAt(Math.floor(Math.random() * POSSIBLE_CHARS.length)); | |
} | |
TEXTAREA.value += (code + '\n'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment