Skip to content

Instantly share code, notes, and snippets.

@jeremy2
Created November 14, 2012 17:54
Show Gist options
  • Save jeremy2/4073660 to your computer and use it in GitHub Desktop.
Save jeremy2/4073660 to your computer and use it in GitHub Desktop.
generate a string of random alpha-numeric characters suitable as a password
# inspired by http://stackoverflow.com/questions/88311/how-best-to-generate-a-random-string-in-ruby
(0...16).map{ (('a'..'z').to_a + (0..9).to_a)[rand(36)] }.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment