Skip to content

Instantly share code, notes, and snippets.

@ElMatella
Created May 26, 2017 10:12
Show Gist options
  • Save ElMatella/302ac884d33ab0da2d8854c261120bbb to your computer and use it in GitHub Desktop.
Save ElMatella/302ac884d33ab0da2d8854c261120bbb to your computer and use it in GitHub Desktop.
let randomstring = require('randomstring')
let found = false
let random;
while (! found) {
random = randomstring.generate({
length: 14,
charset: 'alphanumeric'
})
process.stdout.clearLine();
process.stdout.cursorTo(0);
process.stdout.write(random)
if (random === 'xxxxxxxxxxxxxx') {
found = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment