Skip to main content

canonicalize

Function canonicalize 

Source
pub fn canonicalize(raw: &[u8]) -> Result<Vec<u8>, ShapeViolation>
Expand description

Validate raw and materialize its Rivest canonical S-expression bytes — the same byte sequence ψ₉ folds through the σ-axis.

Available only under the alloc feature. The no_alloc pipeline path never materializes the canonical form; it streams it through the hasher via SExprCanon’s [ChunkSource] impl.

§Errors

Surfaces the [ShapeViolation] SExprCanon::validate would raise.