Hash consistency fixes

This commit is contained in:
doombubbles
2023-08-21 13:28:25 -07:00
parent 9897c9c9bd
commit bc4e52f790
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -381,7 +381,7 @@ paths:
Hashing function for python:
```python
def digest(data: dict | str) -> str:
json_str = data if isinstance(data, str) else json.dumps(data)
json_str = data if isinstance(data, str) else json.dumps(data, separators=(',', ':'))
json_bytes = json_str.encode('utf-8')
hash_object = hashlib.sha256(json_bytes)
return hash_object.hexdigest()