jam-cloud/admin/lib/utils.rb

8 lines
222 B
Ruby
Raw Permalink Normal View History

module Utils
2013-01-05 09:43:40 +00:00
def self::random_password(size = 16)
chars = ((('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0))
(1..size).collect{|a| cc = chars[rand(chars.size)]; 0==rand(2) ? cc.upcase : cc }.join
end
end