Class: Devise::Encryptors::AuthlogicSha512
- Inherits:
-
Object
- Object
- Devise::Encryptors::AuthlogicSha512
- Defined in:
- lib/devise/encryptors/authlogic_sha512.rb
Overview
AuthlogicSha512
Simulates Authlogic’s default encryption mechanism. Warning: it uses Devise’s stretches configuration to port Authlogic’s one. Should be set to 20 in the initializer to silumate
the default behavior.
Class Method Summary collapse
-
.digest(password, stretches, salt, pepper) ⇒ Object
Gererates a default password digest based on salt, pepper and the incoming password.
Class Method Details
.digest(password, stretches, salt, pepper) ⇒ Object
Gererates a default password digest based on salt, pepper and the incoming password.
20 21 22 23 24 |
# File 'lib/devise/encryptors/authlogic_sha512.rb', line 20 def self.digest(password, stretches, salt, pepper) digest = [password, salt].flatten.join('') stretches.times { digest = Digest::SHA512.hexdigest(digest) } digest end |