Python Base64编码解码

import base64

str = '12345678'.encode('utf8')
print(base64.b64encode(str).decode('utf8'))                           # 编码   接收的参数为bytes类型
print(base64.b64decode(base64.b64encode(str)).decode('utf8'))         # 解码   接收的参数为bytes类型

  

原文地址:https://www.cnblogs.com/frank-shen/p/10345917.html