Sha256: b5428c96ac87035db111fd57c5fc344634058ff5a5bf7b0a74bc8764308d2187
Contents?: true
Size: 806 Bytes
Versions: 35
Compression:
Stored size: 806 Bytes
Contents
require "digest/sha1" module Sorcery module CryptoProviders # 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. class SHA1 include Common class << self def join_token @join_token ||= "--" end # Turns your raw password into a Sha1 hash. def encrypt(*tokens) tokens = tokens.flatten digest = tokens.shift stretches.times { digest = secure_digest([digest, *tokens].join(join_token)) } digest end def secure_digest(digest) Digest::SHA1.hexdigest(digest) end end end end end
Version data entries
35 entries across 35 versions & 3 rubygems