blake3 source hash of (frontmatter + body) — the attestation freshness anchor, mirroring the CLI bridges.
(frontmatter: &Map<String, Value>, body: &str)
| 3070 | /// blake3 source hash of (frontmatter + body) — the attestation freshness |
| 3071 | /// anchor, mirroring the CLI bridges. |
| 3072 | fn source_content_hash(frontmatter: &Map<String, Value>, body: &str) -> String { |
| 3073 | let fm = serde_json::to_string(frontmatter).unwrap_or_default(); |
| 3074 | let mut hasher = blake3::Hasher::new(); |
| 3075 | hasher.update(fm.as_bytes()); |
| 3076 | hasher.update(b"\0"); |
| 3077 | hasher.update(body.as_bytes()); |
| 3078 | format!("blake3:{}", hasher.finalize().to_hex()) |
| 3079 | } |
| 3080 | |
| 3081 | fn write_all(path: &std::path::Path, bytes: &[u8]) -> Result<(), Status> { |
| 3082 | if let Some(parent) = path.parent() { |
no test coverage detected