模块 base64 生成token

import base64

key = "zxc"
secret = "das"

string = "app:%s:%s" % (key, secret)
bstring = base64.b64encode(string.encode("utf8")).decode('utf8')
auth = "Bearer %s" % bstring
print(auth)

你可能感兴趣的:(模块 base64 生成token)