Skip to content

Instantly share code, notes, and snippets.

@rjungemann
Created March 10, 2011 00:08
Show Gist options
  • Save rjungemann/863292 to your computer and use it in GitHub Desktop.
Save rjungemann/863292 to your computer and use it in GitHub Desktop.
Single-line password generator
# http://codegolf.stackexchange.com/questions/1360/how-to-write-a-single-line-password-generator
a = [('a'..'z'), ('A'..'Z'), (0..9)].map { |n| n.to_a }.flatten
puts (0...8).map { a[a.size * rand] }.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment