mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
Remove fallback method for environments not supporting usedforsecurity
Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
This commit is contained in:
parent
f62726fd76
commit
4a7299befa
1 changed files with 1 additions and 8 deletions
|
@ -16,11 +16,4 @@ def generate_chunk_id(document_id: str, chunk_text: str) -> str:
|
|||
Adding usedforsecurity=False for compatibility with FIPS environments.
|
||||
"""
|
||||
hash_input = f"{document_id}:{chunk_text}".encode()
|
||||
|
||||
try:
|
||||
md5_hash = hashlib.md5(hash_input, usedforsecurity=False).hexdigest()
|
||||
except TypeError:
|
||||
# Fallback for environments that don't support usedforsecurity (e.g., Python < 3.9 or non-OpenSSL backends)
|
||||
md5_hash = hashlib.md5(hash_input).hexdigest()
|
||||
|
||||
return str(uuid.UUID(md5_hash))
|
||||
return str(uuid.UUID(hashlib.md5(hash_input, usedforsecurity=False).hexdigest()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue