Skip to content

Instantly share code, notes, and snippets.

@tkawachi
Created August 14, 2012 01:23
Show Gist options
  • Select an option

  • Save tkawachi/3345511 to your computer and use it in GitHub Desktop.

Select an option

Save tkawachi/3345511 to your computer and use it in GitHub Desktop.
rand_string
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