MCPcopy Create free account
hub / github.com/ccxt/ccxt / hash

Method hash

python/ccxt/base/exchange.py:1378–1388  ·  view source on GitHub ↗
(request, algorithm='md5', digest='hex')

Source from the content-addressed store, hash-verified

1376
1377 @staticmethod
1378 def hash(request, algorithm='md5', digest='hex'):
1379 if algorithm == 'keccak':
1380 binary = bytes(keccak.SHA3(request))
1381 else:
1382 h = hashlib.new(algorithm, request)
1383 binary = h.digest()
1384 if digest == 'base64':
1385 return Exchange.binary_to_base64(binary)
1386 elif digest == 'hex':
1387 return Exchange.binary_to_base16(binary)
1388 return binary
1389
1390 @staticmethod
1391 def hmac(request, secret, algorithm=hashlib.sha256, digest='hex'):

Callers 15

hash_messageMethod · 0.45
action_hashMethod · 0.45
signMethod · 0.45
hash_messageMethod · 0.45
hash_messageMethod · 0.45
signMethod · 0.45

Calls 2

binary_to_base64Method · 0.80
binary_to_base16Method · 0.80

Tested by

no test coverage detected