Created
February 8, 2012 05:59
-
-
Save nazarhussain/1765902 to your computer and use it in GitHub Desktop.
Custom Encryptor for Devise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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