Created
October 6, 2009 11:58
-
-
Save stevenwilkin/202949 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
#!/usr/bin/env ruby | |
# random_password.rb | |
# generate a random string of 12 alphanumeric characters | |
# Steven Wilkin @stevebiscuit | |
chars = ('0'..'9').to_a + ('A'..'Z').to_a + ('a'..'z').to_a | |
12.times {print chars[rand(chars.length)]} | |
puts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment