Websocket
Generating HASH-KEY
from random import choice
import hashlib
API_SECRET = '...'
API_KEY = '...'
def generate_digits(code_length) -> str:
code = ""
for i in range(code_length):
code += choice(digits)
return code
request_ts = generate_digits(18)
concatenated_string = API_SECRET + request_ts + API_KEY
hash_string = hashlib.sha256((concatenated_string).encode('utf8')).hexdigest()
API_KEY # API_KEY
hash_string # HASH
request_ts # REQUEST_TS
Last updated