Skip to content

Commit

Permalink
Use hashlib.sha256 to avoid any ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleya committed Oct 30, 2024
1 parent bc85dd6 commit caeb2bd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import logging
import hashlib
from datetime import datetime
from hashlib import sha256
from hmac import new
from os import environ
from urllib.parse import urlencode, urlunparse
Expand Down Expand Up @@ -56,7 +56,7 @@ def sign(self, timestamp: str, uri: str) -> str:
"""
params = "".join([self.api_username, timestamp, uri])
return new(
self.api_key.encode("utf-8"), params.encode("utf-8"), digestmod=sha256
self.api_key.encode("utf-8"), params.encode("utf-8"), digestmod=hashlib.sha256
).hexdigest()


Expand Down

0 comments on commit caeb2bd

Please sign in to comment.