Skip to content

Instantly share code, notes, and snippets.

@DamianZaremba
Created May 11, 2011 23:47
Show Gist options
  • Save DamianZaremba/967645 to your computer and use it in GitHub Desktop.
Save DamianZaremba/967645 to your computer and use it in GitHub Desktop.
def gen_rand_str()
return (0...20).map{
('a'..'z').to_a[rand(26)] +
('A'..'Z').to_a[rand(26)] +
('0'..'9').to_a[rand(10)]
}.join
end
puts gen_rand_str()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment