Trait Compute

Source
pub trait Compute<'id, T>: Borrow<[u8]> {
    // Required method
    fn compute_hash(&'id self) -> IdHash<'id, T>;
}
Expand description

Trait for computing BLAKE3 hashes of AtomIds.

This trait is implemented for AtomId to provide a way to compute cryptographically secure hashes that can be used as unique identifiers for atoms in storage backends.

Required Methods§

Source

fn compute_hash(&'id self) -> IdHash<'id, T>

Computes the BLAKE3 hash of this AtomId.

The hash is computed using a key derived from the atom’s root value, ensuring that atoms with the same ID but different roots produce different hashes.

§Returns

An IdHash containing the 32-byte BLAKE3 hash and a reference to the original AtomId.

Implementors§

Source§

impl<'id, R: AsRef<[u8]>> Compute<'id, R> for AtomId<R>