字符串與base64互轉
字符串與 base64 互轉示例:
import base64
str_ = "hello world"
# str 轉 base64
bs64_str = base64.b64encode(str_.encode())
print(bs64_str)
print()
# base64 轉 str
to_str = base64.b64decode(bs64_str)
print(to_str)
字符串與 base64 互轉示例:
import base64
str_ = "hello world"
# str 轉 base64
bs64_str = base64.b64encode(str_.encode())
print(bs64_str)
print()
# base64 轉 str
to_str = base64.b64decode(bs64_str)
print(to_str)
繼續運行 ?* 回憶上次內容 上次使用shell環境中的命令 命令 作用 c