0
Seguir
0
Seguidores

Pregunta sobre Python en Gate.IO (1/3): interpretación del código HttpUtil.py

Creado el: 2018-01-29 11:03:49, Actualizado el:
comments   1
hits   2456

El código de Gate.IO python está disponible en Github en https://github.com/gateio/rest/blob/master/python/HttpUtil.py ¿Algún experto puede analizar el código?

#!/usr/bin/python

-- coding: utf-8 --

import http.client import urllib import json from hashlib import sha512 import hmac / ¿Alguien sabe qué es HMAC y en qué versión de Python?

/ Pregunta 1: ¿Se requiere esto para que Python 3X esté preinstalado en el servidor local o 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

/ ¿Alguien puede descifrar el código de la interfaz GATE.IO?