Sha256: 2765eca3085e7614bd3571042712ad235881686bef546e775f2319d5f5aa27fb

Contents?: true

Size: 343 Bytes

Versions: 92

Compression:

Stored size: 343 Bytes

Contents

module Braintree
  module SHA256Digest # :nodoc:
    def self.hexdigest(private_key, string)
      _hmac(private_key, string)
    end

    def self._hmac(key, message)
      key_digest = ::Digest::SHA256.digest(key)
      sha256 = OpenSSL::Digest.new("sha256")
      OpenSSL::HMAC.hexdigest(sha256, key_digest, message.to_s)
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
braintree-4.15.0 lib/braintree/sha256_digest.rb
braintree-4.14.0 lib/braintree/sha256_digest.rb
braintree-4.13.0 lib/braintree/sha256_digest.rb
braintree-4.12.0 lib/braintree/sha256_digest.rb
braintree-4.11.0 lib/braintree/sha256_digest.rb
braintree-4.10.0 lib/braintree/sha256_digest.rb
braintree-4.9.0 lib/braintree/sha256_digest.rb
braintree-4.8.0 lib/braintree/sha256_digest.rb
braintree-4.7.0 lib/braintree/sha256_digest.rb
braintree-4.6.0 lib/braintree/sha256_digest.rb
braintree-4.5.0 lib/braintree/sha256_digest.rb
braintree-4.4.0 lib/braintree/sha256_digest.rb
braintree-4.3.0 lib/braintree/sha256_digest.rb
braintree-4.2.0 lib/braintree/sha256_digest.rb
braintree-4.1.0 lib/braintree/sha256_digest.rb
braintree-4.0.0 lib/braintree/sha256_digest.rb
braintree-3.4.0 lib/braintree/sha256_digest.rb
braintree-3.3.0 lib/braintree/sha256_digest.rb
braintree-3.2.0 lib/braintree/sha256_digest.rb
braintree-3.1.0 lib/braintree/sha256_digest.rb