OXIESEC PANEL
- Current Dir:
/
/
snap
/
core
/
17200
/
usr
/
lib
/
python3
/
dist-packages
/
jwt
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/18/2024 07:58:21 PM
rwxr-xr-x
📄
__init__.py
707 bytes
05/22/2015 03:50:55 PM
rw-r--r--
📄
__main__.py
3.49 KB
05/22/2015 03:50:55 PM
rw-r--r--
📁
__pycache__
-
02/18/2024 07:58:21 PM
rwxr-xr-x
📄
algorithms.py
8.56 KB
08/29/2017 06:41:31 PM
rw-r--r--
📄
api_jws.py
6.01 KB
05/22/2015 03:50:55 PM
rw-r--r--
📄
api_jwt.py
6 KB
05/22/2015 03:50:55 PM
rw-r--r--
📄
compat.py
1.17 KB
05/22/2015 03:50:55 PM
rw-r--r--
📁
contrib
-
02/18/2024 07:58:21 PM
rwxr-xr-x
📄
exceptions.py
643 bytes
04/26/2015 06:00:59 PM
rw-r--r--
📄
utils.py
1.53 KB
05/22/2015 03:50:55 PM
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 sys import hmac PY3 = sys.version_info[0] == 3 if PY3: string_types = str, text_type = str else: string_types = basestring, text_type = unicode 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