Skip to content

Instantly share code, notes, and snippets.

@rbazinet
Created August 1, 2009 04:27
Show Gist options
  • Save rbazinet/159566 to your computer and use it in GitHub Desktop.
Save rbazinet/159566 to your computer and use it in GitHub Desktop.
class KeyGenerator
require "digest/sha1"
def self.generate(length = 10)
Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s)[1..length]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment