Sha256: e9e7104a0608efd70da148d7dfc71ec36e8d4f3cc4b67eb146a4db995cda22f1

Contents?: true

Size: 514 Bytes

Versions: 84

Compression:

Stored size: 514 Bytes

Contents

# 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

Version data entries

84 entries across 80 versions & 11 rubygems

Version Path
activesupport-8.0.0 lib/active_support/digest.rb
activesupport-7.2.2 lib/active_support/digest.rb
activesupport-7.1.5 lib/active_support/digest.rb
activesupport-8.0.0.rc2 lib/active_support/digest.rb
activesupport-7.2.1.2 lib/active_support/digest.rb
activesupport-7.1.4.2 lib/active_support/digest.rb
activesupport-7.0.8.6 lib/active_support/digest.rb
activesupport-8.0.0.rc1 lib/active_support/digest.rb
activesupport-7.2.1.1 lib/active_support/digest.rb
activesupport-7.1.4.1 lib/active_support/digest.rb
activesupport-7.0.8.5 lib/active_support/digest.rb
activesupport-8.0.0.beta1 lib/active_support/digest.rb
omg-activesupport-8.0.0.alpha9 lib/active_support/digest.rb
omg-activesupport-8.0.0.alpha8 lib/active_support/digest.rb
omg-activesupport-8.0.0.alpha7 lib/active_support/digest.rb
omg-activesupport-8.0.0.alpha4 lib/active_support/digest.rb
omg-activesupport-8.0.0.alpha3 lib/active_support/digest.rb
omg-activesupport-8.0.0.alpha2 lib/active_support/digest.rb
omg-activesupport-8.0.0.alpha1 lib/active_support/digest.rb
activesupport-7.1.4 lib/active_support/digest.rb