예제 #1
0
 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()
예제 #2
0
 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()