diff --git a/docling_core/types/doc/document.py b/docling_core/types/doc/document.py index e47e4a44..0fb08f04 100644 --- a/docling_core/types/doc/document.py +++ b/docling_core/types/doc/document.py @@ -1073,7 +1073,7 @@ def _image_to_hexhash(self) -> Optional[str]: image_bytes = self.image._pil.tobytes() # Create a hash object (e.g., SHA-256) - hasher = hashlib.sha256() + hasher = hashlib.sha256(usedforsecurity=False) # Feed the image bytes into the hash object hasher.update(image_bytes) diff --git a/docling_core/utils/legacy.py b/docling_core/utils/legacy.py index 74f91867..1ff424d5 100644 --- a/docling_core/utils/legacy.py +++ b/docling_core/utils/legacy.py @@ -47,7 +47,7 @@ def _create_hash(string: str): - hasher = hashlib.sha256() + hasher = hashlib.sha256(usedforsecurity=False) hasher.update(string.encode("utf-8")) return hasher.hexdigest()