Skip to main content

Base64Encoder

Standard (non-URL-safe) Base64 encoder.

Methods


decode()

@classmethod
def decode(
data: bytes
) - > bytes

Decode the data from base64 encoded bytes to original bytes data.

Parameters

NameTypeDescription
databytesThe base64 encoded byte sequence to be decoded back into its original form.

Returns

TypeDescription
bytesThe decoded data.

encode()

@classmethod
def encode(
value: bytes
) - > bytes

Encode the data from bytes to a base64 encoded bytes.

Parameters

NameTypeDescription
valuebytesThe raw byte data to be converted into a base64 encoded byte string.

Returns

TypeDescription
bytesThe encoded data.

get_json_format()

@classmethod
def get_json_format() - > Literal['base64']

Get the JSON format for the encoded data.

Returns

TypeDescription
Literal['base64']The JSON format for the encoded data.