Created
December 5, 2014 16:28
-
-
Save bahelms/a572c6d4a103925c30a4 to your computer and use it in GitHub Desktop.
Random String generation
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
# Replace the variable 'size' with the desired string length | |
o = [('a'..'z'), ('A'..'Z'), (0..9)].map { |i| i.to_a }.flatten; string = (0...size).map { o[rand(o.length)] }.join |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment