Skip to content

Instantly share code, notes, and snippets.

@nazarhussain
Created February 8, 2012 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazarhussain/1765902 to your computer and use it in GitHub Desktop.
Save nazarhussain/1765902 to your computer and use it in GitHub Desktop.
Custom Encryptor for Devise
module Devise
module Encryptors
class Sha1
def self.digest(password, user_salt)
string_to_hash = password + "abcdefgh" + user_salt
Digest::SHA1.hexdigest(string_to_hash)
end
def self.salt(username)
self.object_id.to_s + rand.to_s
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment