Sha256: efda8b1651c20048dd29656be226cf5e41c993e2ed061dc37a1481ed6f6c6061

Contents?: true

Size: 349 Bytes

Versions: 11

Compression:

Stored size: 349 Bytes

Contents

module Braintree
  module Digest # :nodoc:
    def self.hexdigest(string)
      _hmac_sha1(Configuration.private_key, string)
    end

    def self._hmac_sha1(key, message)
      key_digest = ::Digest::SHA1.digest(key)
      sha1 = OpenSSL::Digest::Digest.new("sha1")
      OpenSSL::HMAC.hexdigest(sha1, key_digest, message.to_s)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
braintree-2.4.0 lib/braintree/digest.rb
braintree-2.3.1 lib/braintree/digest.rb
braintree-2.2.0 lib/braintree/digest.rb
braintree-2.1.0 lib/braintree/digest.rb
braintree-2.0.0 lib/braintree/digest.rb
braintree-1.2.1 lib/braintree/digest.rb
braintree-1.2.0 lib/braintree/digest.rb
braintree-1.1.3 lib/braintree/digest.rb
braintree-1.1.2 lib/braintree/digest.rb
braintree-1.1.1 lib/braintree/digest.rb
braintree-1.1.0 lib/braintree/digest.rb