/** * Deterministic JSON canonicalization per RFC 8785 (JSON Canonicalization Scheme), * with the clarifications mandated by Rubric Verify Spec v1.0.0-rc1 §6.1. * * Ported from @rubric/verify v1.0.0-rc.1 src/canonical.ts (Phase 1 of the * Federation v1 Refactor). Dependency-free. * * RFC 8785 / Rubric Verify Spec §6.1 rules: * 1. Object keys MUST be sorted lexicographically (UTF-16 code unit order). * 2. There MUST be no whitespace between tokens. * 3. Numbers MUST be serialized using the shortest representation that * round-trips through IEEE 754 double-precision parsing. * 4. Strings MUST be UTF-8 encoded. * 5. Boolean values MUST be `true` or `false` (lowercase). * 6. The null value MUST be `null` (lowercase). * 7. Arrays MUST preserve their input order. * 8. The output MUST be UTF-8 encoded; the canonical message bytes are the * UTF-8 encoding of the canonicalized string. */ export declare class CanonicalInputError extends Error { constructor(message: string); } /** * Canonicalize a JSON-compatible value to its RFC 8785 form (UTF-8 string). */ export declare function canonicalize(value: unknown): string; /** * UTF-8-encode the canonicalization of `value`. * * Equivalent to `new TextEncoder().encode(canonicalize(value))`. */ export declare function canonicalizeBytes(value: unknown): Uint8Array; /** * SHA-256 hex digest of the canonicalization of `value`. * * Bare lowercase hex, no algorithm prefix, no `0x` prefix. Matches the * `payload_hash` format mandated by Rubric Verify Spec §6.3. */ export declare function canonicalSha256Hex(value: unknown): string; //# sourceMappingURL=canonical.d.ts.map