Skip to content

Instantly share code, notes, and snippets.

@Lytol Lytol/gist:24613
Created Nov 13, 2008

Embed
What would you like to do?
require 'digest/sha1'
module SecureToken
def self.secure_digest(*args)
Digest::SHA1.hexdigest(args.flatten.join('--'))
end
def self.generate_token
secure_digest(Time.now, (1..10).map{ rand.to_s })
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.