Skip to main content

Base64UrlEncoder

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 URL-safe base64 encoded bytes to be converted back to their 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 bytes data to be encoded into a URL-safe base64 format.

Returns

TypeDescription
bytesThe encoded data.

get_json_format()

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

Get the JSON format for the encoded data.

Returns

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