Trait nmt_rs::NamespaceMerkleHasher
source · pub trait NamespaceMerkleHasher<const NS_ID_SIZE: usize>: MerkleHash {
// Required methods
fn with_ignore_max_ns(ignore_max_ns: bool) -> Self;
fn ignores_max_ns(&self) -> bool;
fn hash_leaf_with_namespace(
&self,
data: &[u8],
namespace: NamespaceId<NS_ID_SIZE>,
) -> <Self as MerkleHash>::Output;
}Expand description
An extension of MerkleHash indicating that the hasher is namespace aware. This allows for the creation of
namespaced merkle trees and namespaced merkle proofs.
Required Methods§
sourcefn with_ignore_max_ns(ignore_max_ns: bool) -> Self
fn with_ignore_max_ns(ignore_max_ns: bool) -> Self
Create a new hasher which ignores the max namespace
sourcefn ignores_max_ns(&self) -> bool
fn ignores_max_ns(&self) -> bool
Check whether the hasher ignores the max namespace
sourcefn hash_leaf_with_namespace(
&self,
data: &[u8],
namespace: NamespaceId<NS_ID_SIZE>,
) -> <Self as MerkleHash>::Output
fn hash_leaf_with_namespace( &self, data: &[u8], namespace: NamespaceId<NS_ID_SIZE>, ) -> <Self as MerkleHash>::Output
Hash the given data and namespace
Object Safety§
This trait is not object safe.