Skip to content

Instantly share code, notes, and snippets.

@aderyabin
Created March 17, 2010 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aderyabin/335138 to your computer and use it in GitHub Desktop.
Save aderyabin/335138 to your computer and use it in GitHub Desktop.
generate random sequence
# generate random sequence
#SecureRandom also has methods for: base64, hex, bytes, random_number
#see: http://api.rubyonrails.org/classes/ActiveSupport/SecureRandom.html
require 'active_support/secure_random'
ActiveSupport::SecureRandom.hex(16)
# outputs: 6dc19d21e958e04645cddadb96e9c927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment