Skip to main content

base64_encode

Base64 encode a string of bytes or text. The resulting bytes are safe to use in URLs.

def base64_encode(string): ...

Base64 encode a string of bytes or text. The resulting bytes are safe to use in URLs.

Parameters

NameTypeDescription
stringUnion[str, bytes]The input text or byte sequence to be encoded into a URL-safe format.

Returns

TypeDescription
bytesThe URL-safe Base64 encoded bytes with any trailing padding characters removed.