模块 base64 生成token

2019-08-27  本文已影响0人  土豆与番茄

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)

上一篇 下一篇

猜你喜欢

热点阅读