The base64
module in Python provides functions for encoding and decoding data using the Base64 encoding scheme. This encoding is used to represent binary data in an ASCII string format. It is commonly used in various applications, including email via MIME and storing complex data in XML or JSON. Below is a list of some commonly used functions in the base64
module, along with their descriptions and links to detailed guides for each function.
For a complete tutorial, visit Python base64 Module Tutorial.
Python base64 Module Functions Table
Function | Description |
---|---|
base64.b64encode() | Encodes bytes-like object using Base64 and returns the encoded bytes. |
base64.b64decode() | Decodes a Base64 encoded bytes-like object or ASCII string and returns the decoded bytes. |
base64.standard_b64encode() | Encodes bytes-like object using the standard Base64 alphabet and returns the encoded bytes. |
base64.standard_b64decode() | Decodes a standard Base64 encoded bytes-like object or ASCII string and returns the decoded bytes. |
base64.urlsafe_b64encode() | Encodes bytes-like object using the URL-safe Base64 alphabet and returns the encoded bytes. |
base64.urlsafe_b64decode() | Decodes a URL-safe Base64 encoded bytes-like object or ASCII string and returns the decoded bytes. |
For more detailed information on each function, refer to the official Python documentation.