Sha256: ea8c6d122cbfbf82af6723c0c423aaa0c192a70282fafa370612a8ceeb6f5bf5
Contents?: true
Size: 484 Bytes
Versions: 32
Compression:
Stored size: 484 Bytes
Contents
require 'base64' require 'openssl' require 'stringio' require 'zlib' module Adyen module Encoding def self.hmac_base64(hmac_key, message) digest = OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), hmac_key, message) Base64.encode64(digest).strip end def self.gzip_base64(message) sio = StringIO.new gz = Zlib::GzipWriter.new(sio) gz.write(message) gz.close Base64.encode64(sio.string).gsub("\n", "") end end end
Version data entries
32 entries across 32 versions & 4 rubygems