code: def createSign(pParams, method, host_url, request_path, secret_key):
      
      sorted_params = sorted(pParams.items(), key=lambda d: d[0], reverse=False)
      encode_params = urllib.parse.urlencode(sorted_params)
      payload = [method, host_url, request_path, encode_params]
      payload = '\n'.join(payload)
      payload = payload.encode(encoding='UTF8')
      secret_key = secret_key.encode(encoding='UTF8')
  
      digest = hmac.new(secret_key, payload, digestmod=hashlib.sha256).digest()
      signature = base64.b64encode(digest)
      signature = signature.decode()
      return signature
docs: from 火币demo, 构造签名
      :param pParams:
      :param method:
      :param host_url:
      :param request_path:
      :param secret_key:
      :return: