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)
| 116 | return b64encode(s).translate(_urlsafe_encode_translation) |
| 117 | |
| 118 | def 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 |
nothing calls this directly
no test coverage detected