Skip to content

Instantly share code, notes, and snippets.

@nazarhussain
Created February 8, 2012 05:59
Show Gist options
  • 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