def _signature(cls, apikey, msg): """Calculation of the SHA-512 authentication signature. @param apikey: API-key dict {'Key': '...', 'Secret': '...'} @param msg: method and parameters (Trade API)""" sign = newhash(apikey['Secret'], msg=msg, digestmod=_sha512) cls._post_headers['Key'] = apikey['Key'] cls._post_headers['Sign'] = sign.hexdigest()
def _signature(cls, apikey, msg): """Calculation of the SHA-512 authentication signature. @param apikey: Trade API-Key {'Key': 'KEY', 'Secret': 'SECRET'} @param msg: Trade API method and parameters""" sign = newhash(str.encode(apikey['Secret']), msg=str.encode(msg), digestmod=_sha512) cls._post_headers['Key'] = apikey['Key'] cls._post_headers['Sign'] = sign.hexdigest()