Le code de Gate.IO python est disponible sur Github à l'adresse https://github.com/gateio/rest/blob/master/python/HttpUtil.py
Je voudrais savoir si quelqu'un d'expert peut m'aider à analyser le code.
#!/usr/bin/python
-- coding: utf-8 --
import http.client
import urllib
import json
from hashlib import sha512
import hmac / Quelqu'un sait ce qu'est HMAC et dans quelle version de Python ?
/ Question 1: Est-ce que tout cela est nécessaire pour que Python 3X soit préinstallé sur un serveur local ou un serveur VPS ?
def getSign(params,secretKey): /
sign = ''
for key in (params.keys()):
sign += key + '=' + str(params[key]) +'&'
sign = sign[:-1]
my_sign = hmac.new( bytes(secretKey,encoding='utf8'),bytes(sign,encoding='utf8'), sha512).hexdigest()
return my_sign
/ Quelqu'un peut-il déchiffrer le code de l'interface GATE.IO ?
不用自己 写签名 sing 了, BotVS 底层已经封装 , 签名都是自动的。 不用看这个https://github.com/gateio/rest/blob/master/python/HttpUtil.py
例子了。
直接用BotVS 写策略 就OK了。
- 1
