copybook-determinism
Determinism primitives for repeatable output validation in copybook-rs.
Overview
This crate compares two codec output byte streams using BLAKE3 digests and reports bounded byte-level differences. It supports decode-only, encode-only, and full round-trip determinism checks, enabling CI pipelines and tests to verify that codec operations are repeatable.
Usage
use ;
let output_a = b"hello world";
let output_b = b"hello world";
let result = compare_outputs;
assert!;
// Stable content hashing
let hash = blake3_hex;
assert_eq!; // hex-encoded BLAKE3
Public API
DeterminismMode— Decode-only, encode-only, or round-trip checkingDeterminismResult— Hash comparison result with optional byte diffsByteDiff— Single byte-level difference descriptorcompare_outputs/compare_outputs_with_limit— Compare two byte slicesfind_byte_differences/find_byte_differences_with_limit— Collect diffsblake3_hex— Hex-encoded BLAKE3 content hash
License
AGPL-3.0-or-later