class Authlogic::CryptoProviders::Sha256::V2
Sha256
¶ ↑
Uses the Sha256
hash algorithm to encrypt passwords.
Attributes
Public Class Methods
Source
# File lib/authlogic/crypto_providers/sha256/v2.rb, line 43 def encrypt(*tokens) digest = tokens.flatten.join(join_token) stretches.times { digest = Digest::SHA256.digest(digest) } digest.unpack1("H*") end
Turns your raw password into a Sha256
hash.
Source
# File lib/authlogic/crypto_providers/sha256/v2.rb, line 51 def matches?(crypted, *tokens) encrypt(*tokens) == crypted end
Does the crypted password match the tokens? Uses the same tokens that were used to encrypt.
Source
# File lib/authlogic/crypto_providers/sha256/v2.rb, line 37 def stretches @stretches ||= 20 end
The number of times to loop through the encryption.