Created
September 10, 2016 19:26
-
-
Save Neurogami/763d1be418b7ea1c4812ac09e3e36264 to your computer and use it in GitHub Desktop.
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 random_string_using_char_set len, chars | |
(0...len).map { chars[rand(chars.size)] }.join | |
end | |
safe_chars = (('A'..'Z').to_a + ('a'..'z').to_a + ('3'..'9').to_a ) - %w{5 S Z l o O} | |
some_string = random_string_using_char_set 50, safe_chars | |
p some_string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment