def getSignature(Token,paramss1): s = getParam(paramss1) print(s) # for k, v in paramss1.items(): # s += k + '=' + v +'&' # s = s[:-1].lower() # return hmac.new(Token,s,hashlib.sha1).digest().encode('base64').rstrip()#刪除末尾的空格 return base64.b64encode(hmac.new(Token.encode('ascii'), s.encode('ascii'), hashlib.sha1).digest())#刪除末尾的空格