rails/activesupport/lib/active_support/digest.rb
Rafael Mendonça França 18707ab17f
Standardize nodoc comments
2021-07-29 21:18:07 +00:00

23 lines
514 B
Ruby

# frozen_string_literal: true
require "openssl"
module ActiveSupport
class Digest # :nodoc:
class << self
def hash_digest_class
@hash_digest_class ||= OpenSSL::Digest::MD5
end
def hash_digest_class=(klass)
raise ArgumentError, "#{klass} is expected to implement hexdigest class method" unless klass.respond_to?(:hexdigest)
@hash_digest_class = klass
end
def hexdigest(arg)
hash_digest_class.hexdigest(arg)[0...32]
end
end
end
end