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

Method hash

atomic-repository/src/repository/conflict_object.rs:316–322  ·  view source on GitHub ↗

The conflict-set identity: Blake3 over the domain-separated canonical bytes. This is the ` ` of the `atomic-conflict` projection header and the freshness check of every pack.

(&self)

Source from the content-addressed store, hash-verified

314 /// bytes. This is the `<conflict-set-hash>` of the `atomic-conflict`
315 /// projection header and the freshness check of every pack.
316 pub fn hash(&self) -> Result<Hash, ConflictObjectError> {
317 let bytes = self.canonical_bytes()?;
318 let mut hasher = blake3::Hasher::new();
319 hasher.update(CONFLICT_SET_HASH_DOMAIN);
320 hasher.update(&bytes);
321 Ok(Hash::from_bytes(hasher.finalize().into()))
322 }
323
324 /// Verify that `claimed` names exactly this object.
325 pub fn verify_hash(&self, claimed: &Hash) -> Result<(), ConflictObjectError> {

Callers 3

verify_hashMethod · 0.45

Calls 3

canonical_bytesMethod · 0.45
updateMethod · 0.45
finalizeMethod · 0.45

Tested by 1