reduce diff

This commit is contained in:
lioZ129 2026-03-26 16:12:10 +08:00
parent c13a5db45b
commit 83fb4350b5
3 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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")

View file

@ -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]]: