Skip to content

Commit 73ea34a

Browse files
committed
Bug fix for issue #6 - (Py2 to Py3 Hmac) opened by @araa47
1 parent 0e18038 commit 73ea34a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/Gateio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import hashlib
1111

1212
def get_sign(secret_key, message):
13-
h = hmac.new(secret_key, message, hashlib.sha512)
14-
return base64.b64encode(h.digest())
13+
h = (base64.b64encode(hmac.new(secret_key.encode('utf-8'), message.encode('utf-8'), hashlib.sha512).digest())).decode()
14+
return h
1515

1616
class GateWs:
1717
def __init__(self, url, apiKey, secretKey):

0 commit comments

Comments
 (0)