OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
jwt
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/17/2025 09:32:20 AM
rwxr-xr-x
📄
__init__.py
761 bytes
09/05/2017 06:15:42 PM
rw-r--r--
📄
__main__.py
4.05 KB
06/21/2017 07:27:06 PM
rw-r--r--
📁
__pycache__
-
07/20/2022 06:59:45 AM
rwxr-xr-x
📄
algorithms.py
12.84 KB
07/19/2022 06:23:32 AM
rw-r--r--
📄
api_jws.py
7.38 KB
09/05/2017 06:14:00 PM
rw-r--r--
📄
api_jwt.py
6.9 KB
09/05/2017 06:14:00 PM
rw-r--r--
📄
compat.py
1.74 KB
03/08/2017 04:28:19 PM
rw-r--r--
📁
contrib
-
07/20/2022 06:59:45 AM
rwxr-xr-x
📄
exceptions.py
841 bytes
07/17/2015 01:17:27 AM
rw-r--r--
📄
utils.py
4.02 KB
07/19/2022 06:23:32 AM
rw-r--r--
Editing: compat.py
Close
""" The `compat` module provides support for backwards compatibility with older versions of python, and compatibility wrappers around optional packages. """ # flake8: noqa import hmac import struct import sys PY3 = sys.version_info[0] == 3 if PY3: text_type = str binary_type = bytes else: text_type = unicode binary_type = str string_types = (text_type, binary_type) def timedelta_total_seconds(delta): try: delta.total_seconds except AttributeError: # On Python 2.6, timedelta instances do not have # a .total_seconds() method. total_seconds = delta.days * 24 * 60 * 60 + delta.seconds else: total_seconds = delta.total_seconds() return total_seconds try: constant_time_compare = hmac.compare_digest except AttributeError: # Fallback for Python < 2.7 def constant_time_compare(val1, val2): """ Returns True if the two strings are equal, False otherwise. The time taken is independent of the number of characters that match. """ if len(val1) != len(val2): return False result = 0 for x, y in zip(val1, val2): result |= ord(x) ^ ord(y) return result == 0 # Use int.to_bytes if it exists (Python 3) if getattr(int, 'to_bytes', None): def bytes_from_int(val): remaining = val byte_length = 0 while remaining != 0: remaining = remaining >> 8 byte_length += 1 return val.to_bytes(byte_length, 'big', signed=False) else: def bytes_from_int(val): buf = [] while val: val, remainder = divmod(val, 256) buf.append(remainder) buf.reverse() return struct.pack('%sB' % len(buf), *buf)