Skip to content

Instantly share code, notes, and snippets.

@uhhuhyeah
Created October 7, 2009 01:29
Show Gist options
  • Save uhhuhyeah/203634 to your computer and use it in GitHub Desktop.
Save uhhuhyeah/203634 to your computer and use it in GitHub Desktop.
def create_token
self.token = secure_digest(Time.now, self.id, (1..10).map{ rand.to_s })
end
def secure_digest(*args)
Digest::SHA1.hexdigest(args.flatten.join('--'))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment