Spaces:
Running
Running
| import hashlib | |
| import json | |
| from typing import Any | |
| def stable_content_hash(payload: dict[str, Any]) -> str: | |
| encoded = json.dumps( | |
| payload, | |
| ensure_ascii=False, | |
| sort_keys=True, | |
| separators=(",", ":"), | |
| ).encode("utf-8") | |
| return hashlib.sha256(encoded).hexdigest() | |