Sha256: c62f113bafa1c2968b1bc4c2660473a91f53cd404473af72a6c3addd63423449

Contents?: true

Size: 420 Bytes

Versions: 1

Compression:

Stored size: 420 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.encode64(raw_body || '')
      Digest::MD5.hexdigest("#{raw_body_encoded}#{Cryptomus.config.api_key}")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cryptomus-0.1.0 lib/cryptomus/signature.rb