MCPcopy Index your code
hub / github.com/RustPython/RustPython / urlsafe_b64encode

Function urlsafe_b64encode

Lib/base64.py:109–116  ·  view source on GitHub ↗

Encode bytes using the URL- and filesystem-safe Base64 alphabet. Argument s is a bytes-like object to encode. The result is returned as a bytes object. The alphabet uses '-' instead of '+' and '_' instead of '/'.

(s)

Source from the content-addressed store, hash-verified

107_urlsafe_decode_translation = bytes.maketrans(b'-_', b'+/')
108
109def urlsafe_b64encode(s):
110 """Encode bytes using the URL- and filesystem-safe Base64 alphabet.
111
112 Argument s is a bytes-like object to encode. The result is returned as a
113 bytes object. The alphabet uses '-' instead of '+' and '_' instead of
114 '/'.
115 """
116 return b64encode(s).translate(_urlsafe_encode_translation)
117
118def urlsafe_b64decode(s):
119 """Decode bytes using the URL- and filesystem-safe Base64 alphabet.

Callers

nothing calls this directly

Calls 2

b64encodeFunction · 0.85
translateMethod · 0.45

Tested by

no test coverage detected