File manager - Edit - /opt/imh-python/lib/python3.9/site-packages/starlette/_compat.py
Back
import hashlib # Compat wrapper to always include the `usedforsecurity=...` parameter, # which is only added from Python 3.9 onwards. # We use this flag to indicate that we use `md5` hashes only for non-security # cases (our ETag checksums). # If we don't indicate that we're using MD5 for non-security related reasons, # then attempting to use this function will raise an error when used # environments which enable a strict "FIPs mode". # # See issue: https://github.com/encode/starlette/issues/1365 try: # check if the Python version supports the parameter # using usedforsecurity=False to avoid an exception on FIPS systems # that reject usedforsecurity=True hashlib.md5(b"data", usedforsecurity=False) # type: ignore[call-arg] def md5_hexdigest(data: bytes, *, usedforsecurity: bool = True) -> str: # pragma: no cover return hashlib.md5( # type: ignore[call-arg] data, usedforsecurity=usedforsecurity ).hexdigest() except TypeError: # pragma: no cover def md5_hexdigest(data: bytes, *, usedforsecurity: bool = True) -> str: return hashlib.md5(data).hexdigest()
| ver. 1.4 |
Github
|
.
| PHP 8.3.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings