Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

quality: Code comment

Clémence Lesné532ba2f87432
diff --git a/persistence/redis.py b/persistence/redis.py
index fc4c7b2..ef21223 100644
--- a/persistence/redis.py
+++ b/persistence/redis.py
@@ -74,4 +74,9 @@ class RedisCache(ICache):
@staticmethod
def _key_to_hash(key: str) -> bytes:
+ """
+ Transform the key into a hash.
+
+ SHA-256 lower the collision probability. Plus, it reduce the key size, which is useful for memory usage.
+ """
return hashlib.sha256(key.encode(), usedforsecurity=False).digest()