Skip to content

Instantly share code, notes, and snippets.

@wraithgar
Created July 7, 2020 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wraithgar/58341e23d0a0f29f18ab591246f29d74 to your computer and use it in GitHub Desktop.
Save wraithgar/58341e23d0a0f29f18ab591246f29d74 to your computer and use it in GitHub Desktop.
quick and dirty password generator
'use strict'
const fs = require('fs')
const words = fs.readFileSync('/usr/share/dict/words', 'utf8').split('\n')
const passwords = []
for (let i = 0; i < 12; i++) {
const randomNumber = Math.floor(Math.random() * words.length)
passwords.push(words[randomNumber])
}
console.log(passwords.join('-'))
@bl-ue
Copy link

bl-ue commented Apr 26, 2021

You could also do something like replace s with $, o with 0, e with 3, etc..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment