Download verifier/core/canonical.py from TTOPM/belel-protocol: direct link, hf CLI and curl.
- Browser
- Download file 230 Bytes
-
https://huggingface.co/TTOPM/belel-protocol/resolve/main/verifier/core/canonical.py
- Command line
-
hf download hf://TTOPM/belel-protocol/verifier/core/canonical.py
-
curl -L -o canonical.py https://huggingface.co/TTOPM/belel-protocol/resolve/main/verifier/core/canonical.py
230 Bytes
| import json, hashlib | |
| def canonical_json(obj) -> bytes: | |
| return json.dumps(obj, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode("utf-8") | |
| def sha256hex(b: bytes) -> str: | |
| return hashlib.sha256(b).hexdigest() | |