fix: replace MD5 with SHA256 in cache key derivation (#528)
This commit is contained in:
@@ -79,8 +79,8 @@ class CachingService:
|
|||||||
if kwargs:
|
if kwargs:
|
||||||
key_data += ":" + json.dumps(kwargs, sort_keys=True)
|
key_data += ":" + json.dumps(kwargs, sort_keys=True)
|
||||||
|
|
||||||
# Create hash for consistent key length
|
# Create hash for consistent key length using a strong hash algorithm
|
||||||
key_hash = hashlib.md5(key_data.encode()).hexdigest()
|
key_hash = hashlib.sha256(key_data.encode("utf-8")).hexdigest()
|
||||||
return f"content_strategy:{cache_type}:{key_hash}"
|
return f"content_strategy:{cache_type}:{key_hash}"
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user