Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

base64

import base64

This module provides interface for encoding binary data into strings and decoding such encoded strings back into binary data based on the base64 encoding specified in RFC4648

The base64 API

Every public name in base64, wherever it is declared. Each links to the page that documents it.

NameKindSummary
base64.decodefunctionDecodes a base64 string into it’s corresponding bytes.
base64.encodefunctionEncodes a byte array into a base64 string

Functions

encode()

base64.encode(data: bytes) -> string

Encodes a byte array into a base64 string

Parameters

  • data (bytes)

Returns string

decode()

base64.decode(data: string) -> bytes

Decodes a base64 string into it’s corresponding bytes.

Parameters

  • data (string)

Returns bytes


2021, Richard Ore and Zuri contributors