Skip to content

Commit 4b967ab

Browse files
authored
fix: hashlib usage for FIPS (#280)
fix usage of hashlib for FIPS Signed-off-by: Michele Dolfi <[email protected]>
1 parent 801f018 commit 4b967ab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docling_core/types/doc/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ def _image_to_hexhash(self) -> Optional[str]:
10731073
image_bytes = self.image._pil.tobytes()
10741074

10751075
# Create a hash object (e.g., SHA-256)
1076-
hasher = hashlib.sha256()
1076+
hasher = hashlib.sha256(usedforsecurity=False)
10771077

10781078
# Feed the image bytes into the hash object
10791079
hasher.update(image_bytes)

docling_core/utils/legacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848

4949
def _create_hash(string: str):
50-
hasher = hashlib.sha256()
50+
hasher = hashlib.sha256(usedforsecurity=False)
5151
hasher.update(string.encode("utf-8"))
5252

5353
return hasher.hexdigest()

0 commit comments

Comments
 (0)