Skip to content

Instantly share code, notes, and snippets.

@strika
Created October 6, 2013 05:32
Show Gist options
  • Save strika/6849935 to your computer and use it in GitHub Desktop.
Save strika/6849935 to your computer and use it in GitHub Desktop.
Generating a random token in Ruby
def generate_token
token = Digest::SHA1.hexdigest([Time.now, rand].join)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment