Documentation
¶
Overview ¶
Package canonical is the canonical form an evidence digest commits to: RFC 8785 (JSON Canonicalization Scheme) as the Proof-of-Control standard pins it down in schema/canonicalization.md. Keys sorted by UTF-16 code unit, no whitespace, minimal escapes, non-ASCII literal, digests tagged with their algorithm, and no floating point in a claim set: a float is refused, not formatted, because number formatting is where canonical forms go wrong quietly.
Index ¶
Constants ¶
const Algorithm = "sha-256"
Variables ¶
var ErrFloat = errors.New("the claim set forbids floating point; see canonicalization.md")
ErrFloat is returned for a non-integer number: the claim set forbids it.
Functions ¶
func Encode ¶
Encode returns the canonical bytes of a value. Maps become objects, slices arrays; json.Number and integers are written as integers; float64 is accepted only when it is a whole number within the safe range.
func Tag ¶
Tag is the wire form of a digest: algorithm-tagged, so evidence written before a hash migration is still interpretable after one.
Types ¶
This section is empty.