Skip to content

Instantly share code, notes, and snippets.

@h3xxx
Created December 10, 2014 12:15
Show Gist options
  • Save h3xxx/0d93e7797c1057f1cac1 to your computer and use it in GitHub Desktop.
Save h3xxx/0d93e7797c1057f1cac1 to your computer and use it in GitHub Desktop.
def makeRandStr(length = 7, chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789')
str = ''
for num in 1..length
str += chars[rand(0..(chars.length - 1))]
end
return str
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment