def random_password(size = 8) chars = (('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
(July 14 - Fixed due to comment by friendly commenter below :))
12378 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
def random_password(size = 8) chars = (('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
You need to create an account or log in to post comments to this site.