Skip to main content

document_signature

Function document_signature 

Source
pub fn document_signature(doc_json: &str) -> String
Expand description

A STABLE content signature of a document: a sorted-key JSON walk hashed with the (fixed-key, cross-process-deterministic) std SipHash. The ONE signature fn, at the ENGINE altitude so app-side and engine-side writers share one copy: the app’s insert flow (panels::file), the edit-in-place Finish (panels::assembly_edit::refresh_library_entry) and the update-components comparison (panels::update_components) all write/compare a parts-library sourceSignature with THIS function — a freshly inserted, unchanged part must always compare up-to-date, which a second copy would break the moment either drifted. Uses the kernel’s shared sorted-key hash, also used for in-memory library fingerprints. Invalid JSON retains the raw-text hashing fallback.