Created
December 10, 2014 12:15
-
-
Save h3xxx/0d93e7797c1057f1cac1 to your computer and use it in GitHub Desktop.
just a variation of https://gist.github.com/11Na/4f917ffcd119cd919450
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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