MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / source_hash

Function source_hash

libatomic/tests/vault_local_test.rs:275–281  ·  view source on GitHub ↗
(frontmatter: &Map<String, Value>, body: &str)

Source from the content-addressed store, hash-verified

273}
274
275fn 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]
284async fn verification_uses_only_a_public_key_and_preserves_the_signed_revision() {

Callers

nothing calls this directly

Calls 3

updateMethod · 0.45
as_bytesMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected