1 2 3 4 5 6 |
chars = ("A".."Z").to_a + ("a".."z").to_a + ("0".."9").to_a
(0...length).map {chars[rand(chars.size)] }.join
end
end
|
Pastie
Support Pastie
or read my
Pastie << self
blog
1 2 3 4 5 6 |
chars = ("A".."Z").to_a + ("a".."z").to_a + ("0".."9").to_a
(0...length).map {chars[rand(chars.size)] }.join
end
end
|