Created
January 17, 2014 12:40
-
-
Save ph3nx/8472731 to your computer and use it in GitHub Desktop.
Generate random strings in Ruby. You can use this method for instance to generate random subdomains.
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 rand_str length | |
('a'..'z').to_a.shuffle[0..length].join | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment