Skip to content

Instantly share code, notes, and snippets.

@sumanmukherjee03
Created July 2, 2011 17:50
Show Gist options
  • Save sumanmukherjee03/1061453 to your computer and use it in GitHub Desktop.
Save sumanmukherjee03/1061453 to your computer and use it in GitHub Desktop.
Generate random strings in ruby 1.9
[0..9, ?a..?z, ?A..?Z].map(&:to_a).flatten.sample(10).join #size has been hard coded as 10 here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment