Skip to main content

Module hashing

Module hashing 

Source
Expand description

Internal helpers for canonical JSON hashing and ArtifactId computation.

This module is not part of the stable API contract (Appendix C.1) and may change. Canonical JSON and ArtifactId hashing helpers.

Policy:

  • Structured data MUST be hashed as canonical JSON bytes (RFC 8785 / JCS-style).
  • Hashed JSON MUST NOT contain floats (fractional numbers); use integer-scaled values or strings instead.

Enums§

CanonicalJsonError
Errors returned when a JSON value cannot participate in canonical hashing.

Functions§

artifact_id_for_bytes
Compute the content-addressed ArtifactId for raw bytes (SHA-256 lowercase hex).
artifact_id_for_json
Compute the content-addressed ArtifactId for structured JSON (canonical JSON bytes + SHA-256).
canonical_json_bytes
Serialize a serde_json::Value into canonical JSON bytes.