def generate_password(length = 6)
chars = ('a'..'z').to_a + ('A'..'Z').to_a + ('1'..'9').to_a - ['o', 'O', 'i', 'I']
Array.new(length) { chars[rand(chars.size)] }.join
end
I got this from "here":http://www.rubyonrailsblog.com/articles/2006/09/29/ruby-on-rails-random-password-generator.
No comments:
Post a Comment