Skip to main content

canonical_bytes

Function canonical_bytes 

Source
pub fn canonical_bytes(expr: &Expr) -> Result<Vec<u8>>
Expand description

Returns the canonical minimal serialization of expr: the plain-mode bitwise frame with no origin and no dense references.

This is the documented smallest canonical byte string for an Expr value and is suitable as a ContentKey input for a content-addressed store. Structurally equal values (including maps and sets in any insertion order) produce identical bytes, and re-encoding a decoded frame is idempotent.