Created
December 5, 2014 14:26
-
-
Save StanBoyet/105397ac7c4f6597d941 to your computer and use it in GitHub Desktop.
Random string
From http://stackoverflow.com/questions/88311/how-best-to-generate-a-random-string-in-ruby
This file contains 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 generate_random_string(length) | |
rand(36**length).to_s(36) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment