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§
Sourcefn compute_hash(&'id self) -> IdHash<'id, T>
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.