前言
之前的文章有提到Base64
编码的实现原理,你一定非常想尝试一下,对吧?对,你非常想尝试一下(不接受反驳,你想你想你很想)。既然你这么想尝试,那今天来看一下在python
中如何使用Base64
对数据进行编码吧!
对字符串进行Base64编码与解码
import base64
text =b'Hello World'
encode_text = base64.b64encode(text)
print(encode_text)
decode_text = base64.b64decode(encode_text