diff --git a/litellm/caching/caching.py b/litellm/caching/caching.py index 69cffc6044a..406a4f8c98a 100644 --- a/litellm/caching/caching.py +++ b/litellm/caching/caching.py @@ -411,7 +411,7 @@ class Cache: Returns: str: The hashed cache key. """ - hash_object = hashlib.sha256(cache_key.encode(), usedforsecurity=False) + hash_object = hashlib.sha256(cache_key.encode()) # Hexadecimal representation of the hash hash_hex = hash_object.hexdigest() verbose_logger.debug("Hashed cache key (SHA-256): %s", hash_hex) diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py index 350bcc20cdc..d29ca1649ff 100644 --- a/litellm/litellm_core_utils/prompt_templates/factory.py +++ b/litellm/litellm_core_utils/prompt_templates/factory.py @@ -3725,7 +3725,7 @@ class BedrockImageProcessor: sample = normalized[:HASH_SAMPLE_BYTES] # --- Compute deterministic hash (sample + total length) --- - hasher = hashlib.sha256(usedforsecurity=False) + hasher = hashlib.sha256() hasher.update(sample) hasher.update( str(len(normalized)).encode("utf-8") diff --git a/litellm/llms/gigachat/file_handler.py b/litellm/llms/gigachat/file_handler.py index 8e77798e4d1..200428a747a 100644 --- a/litellm/llms/gigachat/file_handler.py +++ b/litellm/llms/gigachat/file_handler.py @@ -29,7 +29,7 @@ _file_cache: Dict[str, str] = {} def _get_url_hash(url: str) -> str: """Generate hash for URL to use as cache key.""" - return hashlib.sha256(url.encode(), usedforsecurity=False).hexdigest() + return hashlib.sha256(url.encode()).hexdigest() def _parse_data_url(data_url: str) -> Optional[Tuple[bytes, str, str]]: