Sha256: a53a8747667cb03e271ff6980fb514afc6a7312a10689c241e5396f12ca3bb70

Contents?: true

Size: 427 Bytes

Versions: 3

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

require 'base64'
require 'digest'

module Cryptomus
  module Signature
    module_function

    # https://doc.cryptomus.com/getting-started/request-format
    # @param raw_body [String]
    # @return [String]
    def generate(raw_body)
      raw_body_encoded = Base64.strict_encode64(raw_body || '')
      Digest::MD5.hexdigest("#{raw_body_encoded}#{Cryptomus.config.api_key}")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cryptomus-0.2.1 lib/cryptomus/signature.rb
cryptomus-0.2.0 lib/cryptomus/signature.rb
cryptomus-0.1.1 lib/cryptomus/signature.rb