Skip to content

Instantly share code, notes, and snippets.

@inem
Forked from aderyabin/gist:335138
Created March 17, 2010 17:11
Show Gist options
  • Save inem/335470 to your computer and use it in GitHub Desktop.
Save inem/335470 to your computer and use it in GitHub Desktop.
# 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