Skip to content

Instantly share code, notes, and snippets.

@modsognir
Created October 18, 2010 07:38
Show Gist options
  • Save modsognir/631880 to your computer and use it in GitHub Desktop.
Save modsognir/631880 to your computer and use it in GitHub Desktop.
config.encryptor = :modsognir
new.encrypted_password = old.crypted_password
new.password_salt = old.salt
new.save(false)
module Devise
module Encryptors
class Modsognir < Base
def self.digest(password, stretches, salt, pepper)
Digest::SHA1.hexdigest("#{salt}-#{password}-#{pepper}")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment