Created
February 2, 2010 11:49
-
-
Save jmcarbo/292603 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def random_password(size = 8) | |
chars = (('A'..'Z').to_a + ('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0) | |
(1..size).collect{|a| chars[rand(chars.size)] }.join | |
end | |
puts random_password.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment