Sha256: 275f0c2ca5793d062bc5211d11c96cdeecd7da9cc255bb23ac9fb7f02ba74910

Contents?: true

Size: 504 Bytes

Versions: 17

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

require "digest"

module ActiveSupport
  class Digest #:nodoc:
    class <<self
      def hash_digest_class
        @hash_digest_class ||= ::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

17 entries across 17 versions & 2 rubygems

Version Path
activesupport-6.1.7.10 lib/active_support/digest.rb
activesupport-6.1.7.9 lib/active_support/digest.rb
activesupport-6.1.7.8 lib/active_support/digest.rb
activesupport-6.1.7.7 lib/active_support/digest.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/digest.rb
activesupport-6.1.7.6 lib/active_support/digest.rb
activesupport-6.1.7.5 lib/active_support/digest.rb
activesupport-6.1.7.4 lib/active_support/digest.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/digest.rb
activesupport-6.1.7.3 lib/active_support/digest.rb
activesupport-6.1.7.2 lib/active_support/digest.rb
activesupport-6.1.7.1 lib/active_support/digest.rb
activesupport-6.1.7 lib/active_support/digest.rb
activesupport-6.1.6.1 lib/active_support/digest.rb
activesupport-6.1.6 lib/active_support/digest.rb
activesupport-6.1.5.1 lib/active_support/digest.rb
activesupport-6.1.5 lib/active_support/digest.rb