Created
March 30, 2016 04:53
-
-
Save mattweidner/052465782be1342f1d6b984e877423d0 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/ruby | |
| # Source characters array | |
| range = [*'0'..'9',*'A'..'Z',*'a'..'z'] | |
| puts "#{range}" | |
| # Build a 20 char random string from the source array. | |
| a = Array.new(20) { range.sample }.join | |
| puts "#{a}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment