Friday, July 22, 2022

Python: Convert string to and from base64 format

Python: Convert string to and from base64 format

Base64 encoding is a format that can be used for data transfer in HTML or general data representation as you don't need to escape it. To convert a stream of byte object to base64 and vice versa, use the following example.
import base64
data = base64.b64encode(b'Hello World')
print(base64.b64decode(data))
# Hello World
view raw basetest.py hosted with ❤ by GitHub

No comments:

Fedora install screen chronicle

Fedora install screen chronicle Below are links to Fedora installation screens. It is interesting to see how it has evolved over time. Fe...