Skip to content

Commit c3937ee

Browse files
sorts cache filter fields when hashing
1 parent 40220c4 commit c3937ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redisvl/redis/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ def buffer_to_array(buffer: bytes, dtype: Any = np.float32) -> List[float]:
4343
def hashify(content: str, extras: Optional[Dict[str, Any]] = None) -> str:
4444
"""Create a secure hash of some arbitrary input text and optional dictionary."""
4545
if extras:
46-
extra_string = " ".join([str(k) + str(v) for k, v in extras.items()])
46+
extra_string = " ".join([str(k) + str(v) for k, v in sorted(extras.items())])
4747
content = content + extra_string
4848
return hashlib.sha256(content.encode("utf-8")).hexdigest()

0 commit comments

Comments
 (0)