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 2650ec7 commit 7b2c894Copy full SHA for 7b2c894
1 file changed
Lib/base64.py
@@ -25,6 +25,7 @@
25
'urlsafe_b64encode', 'urlsafe_b64decode',
26
]
27
28
+_ALLOWED_BASE16_CHARS = frozenset(b'0123456789ABCDEF')
29
30
bytes_types = (bytes, bytearray) # Types acceptable as binary data
31
@@ -283,8 +284,7 @@ def b16decode(s, casefold=False):
283
284
s = _bytes_from_decode_data(s)
285
if casefold:
286
s = s.upper()
- delete= b'0123456789abcdef'
287
- if any(c not in delete for c in s):
+ if any(c not in _ALLOWED_BASE16_CHARS for c in s):
288
raise binascii.Error('Non-base16 digit found')
289
return binascii.unhexlify(s)
290
0 commit comments