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

Function urlsafe_b64decode

Lib/base64.py:118–131  ·  view source on GitHub ↗

Decode bytes using the URL- and filesystem-safe Base64 alphabet. Argument s is a bytes-like object or ASCII string to decode. The result is returned as a bytes object. A binascii.Error is raised if the input is incorrectly padded. Characters that are not in the URL-safe base-64 a

(s)

Source from the content-addressed store, hash-verified

116 return b64encode(s).translate(_urlsafe_encode_translation)
117
118def urlsafe_b64decode(s):
119 """Decode bytes using the URL- and filesystem-safe Base64 alphabet.
120
121 Argument s is a bytes-like object or ASCII string to decode. The result
122 is returned as a bytes object. A binascii.Error is raised if the input
123 is incorrectly padded. Characters that are not in the URL-safe base-64
124 alphabet, and are not a plus '+' or slash '/', are discarded prior to the
125 padding check.
126
127 The alphabet uses '-' instead of '+' and '_' instead of '/'.
128 """
129 s = _bytes_from_decode_data(s)
130 s = s.translate(_urlsafe_decode_translation)
131 return b64decode(s)
132
133
134

Callers

nothing calls this directly

Calls 3

_bytes_from_decode_dataFunction · 0.85
b64decodeFunction · 0.85
translateMethod · 0.45

Tested by

no test coverage detected