systemprompt_sync/diff/mod.rs
1//! Pure-function diff calculators for content.
2//!
3//! Each calculator hashes the disk-side and database-side representations
4//! and emits a structured diff (`added`/`modified`/`removed`/`unchanged`)
5//! without mutating either side.
6
7mod content;
8
9pub use content::ContentDiffCalculator;
10
11use sha2::{Digest, Sha256};
12
13pub fn compute_content_hash(body: &str, title: &str) -> String {
14 let mut hasher = Sha256::new();
15 hasher.update(title.as_bytes());
16 hasher.update(body.as_bytes());
17 hex::encode(hasher.finalize())
18}