/** * The one canonical-JSON serialisation used by every digest this package defines. * * Two digests depend on it — `canonicalContractDigest` (what "good" means) and * `canonicalSubjectDigest` (what was actually checked) — and both must be computed identically * by this package AND by Forge, or evidence written by one component silently fails to validate * in the other. Sharing one implementation is what makes that guarantee real: a second * hand-maintained copy could only ever agree with itself, which is the failure mode a test * cannot catch because both copies pass their own tests. * * Deliberately filesystem-free and side-effect-free. Anything needing real paths, symlink * resolution or git state belongs at the server boundary, not here. */ /** * Compare by Unicode code point. UTF-8's byte order matches code point order, so comparing code * points is sufficient and avoids depending on the host's locale-sensitive default collation — * `String.prototype.localeCompare` would make the digest environment-dependent. */ export declare function compareByCodePoint(a: string, b: string): number; /** * Recursively sort object keys by code point and normalise every string to NFC. * * ARRAY ORDER IS PRESERVED. Array order is frequently semantic — acceptance criteria run in * declared order — so a caller that needs a non-semantic array sorted must sort it BEFORE * calling this function, exactly as the contract digest sorts `artifacts` and the subject digest * sorts `repositories` and `artifacts`. */ export declare function canonicalizeValue(value: unknown): unknown; /** Canonicalise, encode as UTF-8 JSON with no insignificant whitespace, and digest with SHA-256. * The `sha256:` prefix names the algorithm in the stored value, so a future change is visible in * the data rather than only in the code that produced it. */ export declare function canonicalDigest(content: unknown): string; //# sourceMappingURL=canonical-json.d.ts.map