Last active
August 29, 2015 13:56
-
-
Save jah2488/8945347 to your computer and use it in GitHub Desktop.
array of random strings of random length
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
ral = -> { Array.new(5) { Array.new(1..10).sample.times.map { Array('a'..'z').sample }.join } } | |
def array_of_random_strings_of_random_length(array_length: 5, string_length: 5, string_range: 'a'..'z') | |
Array.new(array_length) do | |
Array(1..string_length).sample.times.map do | |
Array(string_range).sample | |
end.join | |
end | |
end | |
#oh the joys of ruby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#dont use this for password hashing or api-key generation