class Authlogic::CryptoProviders::Sha256
Sha256
¶ ↑
Uses the Sha256
hash algorithm to encrypt passwords.
Attributes
Public Class Methods
Source
# File lib/authlogic/crypto_providers/sha256.rb, line 45 def encrypt(*tokens) digest = tokens.flatten.join(join_token) stretches.times { digest = Digest::SHA256.hexdigest(digest) } digest end
Turns your raw password into a Sha256
hash.
Source
# File lib/authlogic/crypto_providers/sha256.rb, line 53 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.rb, line 39 def stretches @stretches ||= 20 end
The number of times to loop through the encryption.