py3 base64加密

import base64
#字符串编码:
encodestr = base64.b64encode('abcr34r344r'.encode('utf-8'))
print(str(encodestr,'utf-8'))
结果:YWJjcjM0cjM0NHI=

# 对字符串解码
base64.b64decode(str2).decode()
 
原文地址:https://www.cnblogs.com/lmh001/p/10268842.html