class Sorcery::CryptoProviders::SHA1
This class was made for the users transitioning from restful_authentication. I highly discourage using this crypto provider as it inferior to your other options. Please use any other provider offered by Sorcery
.
Public Class Methods
encrypt(*tokens)
click to toggle source
Turns your raw password into a Sha1 hash.
# File lib/sorcery/crypto_providers/sha1.rb, line 15 def encrypt(*tokens) tokens = tokens.flatten digest = tokens.shift stretches.times { digest = secure_digest([digest, *tokens].join(join_token)) } digest end
join_token()
click to toggle source
# File lib/sorcery/crypto_providers/sha1.rb, line 10 def join_token @join_token ||= '--' end
secure_digest(digest)
click to toggle source
# File lib/sorcery/crypto_providers/sha1.rb, line 22 def secure_digest(digest) Digest::SHA1.hexdigest(digest) end