Skip to content

Commit

Permalink
encode message before hmac
Browse files Browse the repository at this point in the history
  • Loading branch information
tykling committed Mar 24, 2017
1 parent fd9d251 commit d2582a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coinify_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def generate_authorization_header(self):
message = nonce + self.api_key

# Compute signature
signature = hmac.new(self.api_secret, msg=message, digestmod=hashlib.sha256).hexdigest()
signature = hmac.new(self.api_secret, msg=message.encode('utf-8'), digestmod=hashlib.sha256).hexdigest()

# Construct the header value
header_value = 'Coinify apikey="%s", nonce="%s", signature="%s"' % (self.api_key, nonce, signature)
Expand Down

0 comments on commit d2582a9

Please sign in to comment.