We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1e16e1 commit 28f584aCopy full SHA for 28f584a
1 file changed
src/joserfc/util.py
@@ -4,7 +4,7 @@
4
import struct
5
import binascii
6
import json
7
-from .errors import DecodeError
+
8
9
def to_bytes(x: Any, charset: str = "utf-8", errors: str = "strict") -> bytes:
10
if isinstance(x, bytes):
@@ -21,16 +21,6 @@ def to_str(x: bytes | str, charset: str = "utf-8") -> str:
21
return x.decode(charset)
22
return x
23
24
-def __is_urlsafe_b64_encoding_non_canonical(s: bytes) -> bool:
25
- p = len(s) % 4 # padding?
26
- if p == 0:
27
- return False
28
- p = 4 - p # number of padding characters
29
- if p == 2 and s[-1] in b"AQgw":
30
31
- if p == 1 and s[-1] in b"AEIMQUYcgkosw048":
32
33
- return True
34
35
def urlsafe_b64decode(s: bytes) -> bytes:
36
if b"+" in s or b"/" in s:
0 commit comments