mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
reduce diff
This commit is contained in:
parent
c13a5db45b
commit
83fb4350b5
3 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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]]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue