Skip to main content

urlsafe_base64_encode

Encode a bytestring to a base64 string for use in URLs. Strip any trailing equal signs.

def urlsafe_base64_encode(
s: bytes
) - > string

Encode a bytestring to a base64 string for use in URLs. Strip any trailing equal signs.

Parameters

NameTypeDescription
sbytesThe bytestring to be encoded into a URL-safe format

Returns

TypeDescription
stringThe URL-safe base64 encoded string with padding removed, decoded as ASCII