Sha256: 9c0151674628a7d904cd13943c49689331b2af94c7df4c4643be05d0a6395ebf
Contents?: true
Size: 654 Bytes
Versions: 23
Compression:
Stored size: 654 Bytes
Contents
require "digest/sha2" module Devise module Encryptors # = 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 simulate # the default behavior. class AuthlogicSha512 < Base # Generates a default password digest based on salt, pepper and the # incoming password. def self.digest(password, stretches, salt, pepper) digest = [password, salt].flatten.join('') stretches.times { digest = Digest::SHA512.hexdigest(digest) } digest end end end end
Version data entries
23 entries across 23 versions & 5 rubygems