Sha256: 1b3b9d3ad17677fc8c9d8cd0f6c4babbadb6ae14817eb8d83a73c2e5bf463432

Contents?: true

Size: 303 Bytes

Versions: 4

Compression:

Stored size: 303 Bytes

Contents

require "openssl"
require "base64"

module MWS
  class QueryString < ::String
    class Signature < ::String
      def initialize(text, key)
        bytes = OpenSSL::HMAC.digest("SHA256", key, text)
        signature = Base64.strict_encode64(bytes)

        super(signature)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
marketplace_web_service-0.0.4 lib/mws/query_string/signature.rb
marketplace_web_service-0.0.3 lib/mws/query_string/signature.rb
marketplace_web_service-0.0.2 lib/mws/query_string/signature.rb
marketplace_web_service-0.0.1 lib/mws/query_string/signature.rb