Sha256: 6395006f974c78921aeb138f90aabd86fa81e2a4e1c4da609fe0c3fc26a901d0

Contents?: true

Size: 306 Bytes

Versions: 7

Compression:

Stored size: 306 Bytes

Contents

require 'openssl'

module Datatrans::Common
  def sign(*fields)
    return nil unless self.datatrans.sign_key
    key = self.datatrans.sign_key.split(/([a-f0-9][a-f0-9])/).reject(&:empty?)
    key = key.pack("H*" * key.size)
    OpenSSL::HMAC.hexdigest(OpenSSL::Digest::MD5.new, key, fields.join)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
datatrans-5.1.0 lib/datatrans/common.rb
datatrans-5.0.0 lib/datatrans/common.rb
datatrans-4.0.1 lib/datatrans/common.rb
datatrans-4.0.0 lib/datatrans/common.rb
datatrans-3.0.2 lib/datatrans/common.rb
datatrans-3.0.1 lib/datatrans/common.rb
datatrans-3.0.0 lib/datatrans/common.rb