instance method
key_generator
Ruby on Rails 8.1.2
Since v4.0.13Signature
key_generator(secret_key_base = self.secret_key_base)
Returns a key generator (ActiveSupport::CachingKeyGenerator) for a specified secret_key_base. The return value is memoized, so additional calls with the same secret_key_base will return the same key generator instance.
Parameters
-
secret_key_baseopt = self.secret_key_base
Source
# File railties/lib/rails/application.rb, line 174
def key_generator(secret_key_base = self.secret_key_base)
# number of iterations selected based on consultation with the google security
# team. Details at https://github.com/rails/rails/pull/6952#issuecomment-7661220
@key_generators[secret_key_base] ||= ActiveSupport::CachingKeyGenerator.new(
ActiveSupport::KeyGenerator.new(secret_key_base, iterations: 1000)
)
end
Defined in railties/lib/rails/application.rb line 174
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Application