Skip to content

Instantly share code, notes, and snippets.

@msadouni
Created November 6, 2009 08:42
Show Gist options
  • Save msadouni/227851 to your computer and use it in GitHub Desktop.
Save msadouni/227851 to your computer and use it in GitHub Desktop.
def random_string(length=10)
chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'
string = ''
length.times { string << chars[rand(chars.size)] }
string
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment