Function
source_hash
(frontmatter: &Map<String, Value>, body: &str)
Source from the content-addressed store, hash-verified
| 273 | } |
| 274 | |
| 275 | fn source_hash(frontmatter: &Map<String, Value>, body: &str) -> String { |
| 276 | let mut hash = blake3::Hasher::new(); |
| 277 | hash.update(serde_json::to_string(frontmatter).unwrap().as_bytes()); |
| 278 | hash.update(b"\0"); |
| 279 | hash.update(body.as_bytes()); |
| 280 | format!("blake3:{}", hash.finalize().to_hex()) |
| 281 | } |
| 282 | |
| 283 | #[tokio::test] |
| 284 | async fn verification_uses_only_a_public_key_and_preserves_the_signed_revision() { |
Callers
nothing calls this directly
Tested by
no test coverage detected