Skip to content

Commit

Permalink
Merge pull request rails#44675 from ghousemohamed/fix-rdoc-highlight-…
Browse files Browse the repository at this point in the history
…in-active-support-key-generator

Fixed rdoc typo highlighting for ActiveSupport::KeyGenerator class [ci-skip]
  • Loading branch information
jonathanhefner committed Mar 13, 2022
2 parents e44d080 + 475756d commit a15543a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activesupport/lib/active_support/key_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ def initialize(secret, options = {})
@hash_digest_class = options[:hash_digest_class] || self.class.hash_digest_class
end

# Returns a derived key suitable for use. The default key_size is chosen
# Returns a derived key suitable for use. The default +key_size+ is chosen
# to be compatible with the default settings of ActiveSupport::MessageVerifier.
# i.e. OpenSSL::Digest::SHA1#block_length
# i.e. <tt>OpenSSL::Digest::SHA1#block_length</tt>
def generate_key(salt, key_size = 64)
OpenSSL::PKCS5.pbkdf2_hmac(@secret, salt, @iterations, key_size, @hash_digest_class.new)
end
end

# CachingKeyGenerator is a wrapper around KeyGenerator which allows users to avoid
# re-executing the key generation process when it's called using the same salt and
# key_size.
# re-executing the key generation process when it's called using the same +salt+ and
# +key_size+.
class CachingKeyGenerator
def initialize(key_generator)
@key_generator = key_generator
Expand Down

0 comments on commit a15543a

Please sign in to comment.