Skip to content

Instantly share code, notes, and snippets.

@jgyllen
Created April 5, 2012 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgyllen/2312464 to your computer and use it in GitHub Desktop.
Save jgyllen/2312464 to your computer and use it in GitHub Desktop.
Create a secure random string in Ruby 1.9
SecureRandom.base64(6).gsub(/[$=+\/]/,65.+(rand(25)).chr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment