Created
August 14, 2012 01:23
-
-
Save tkawachi/3345511 to your computer and use it in GitHub Desktop.
rand_string
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 rand_string(length=16) | |
| chars = [*('A'..'Z'), *('a'..'z'), *(0..9)] | |
| (0..length).map {chars.sample}.join | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment