Binary and Encoding Modules
base64
Convert bytes to printable ASCII representations using base16, base32, base64 and base85 encodings. Base64 is reversible and provides no secrecy or authentication. For standard base64 decoding of external data consider validate=True; URL-safe alphabets have different characters.
Formal Syntax & Structure
python syntaxpython
import base64Return Value
module
Module namespace available through import; import is a statement, not a value-returning expression.
Working Example
Example Snippetpython
import base64encoded = base64.b64encode(b"order:7")print(encoded.decode("ascii"))print(base64.b64decode(encoded, validate=True))