Expand description
Row digests (Phase 3 spec, section 5.1).
The ledger keeps a digest of each row instead of the row: SHA-256 of the
canonical JSON of [value, ord, part], truncated to 16 bytes and written as
32 hex characters. Canonical JSON is compact and sorts object keys by their
UTF-8 bytes; strings are escaped exactly as serde_json escapes them, so the
canonical length of a value is also its compact encoded size. The digest
never leaves the app.
Functionsยง
- canonical_
json - The canonical JSON of
value. - canonical_
len - The canonical (and compact) encoded size of
value, in bytes. - row_
digest - The ledger digest of a row: what changes when its value, order or group does.
- write_
canonical - Appends the canonical JSON of
valuetoout.