Class: Auth

Inherits:
Object
  • Object
show all
Defined in:
lib/http/auth.rb

Class Method Summary collapse

Class Method Details

.get_signature(api_key:, query:) ⇒ Object



5
6
7
8
# File 'lib/http/auth.rb', line 5

def self.get_signature(api_key:, query:)
  data = query ? query.force_encoding('UTF-8') : ''
  Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), api_key, data)).strip
end