fix: usage of hashlib for FIPS (#1512)

fix usage of hashlib for FIPS

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi
2025-05-02 15:03:29 +02:00
committed by GitHub
parent de56523974
commit 7c705739f9
2 changed files with 5 additions and 3 deletions

View File

@@ -189,7 +189,9 @@ class DocumentConverter:
def _get_pipeline_options_hash(self, pipeline_options: PipelineOptions) -> str:
"""Generate a hash of pipeline options to use as part of the cache key."""
options_str = str(pipeline_options.model_dump())
return hashlib.md5(options_str.encode("utf-8")).hexdigest()
return hashlib.md5(
options_str.encode("utf-8"), usedforsecurity=False
).hexdigest()
def initialize_pipeline(self, format: InputFormat):
"""Initialize the conversion pipeline for the selected format."""