pub enum HashFn {
Blake3,
}Expand description
Multicodec-tagged hash function.
Per the event-DAG substrate brief §13, every digest field carries its hash function identifier alongside the digest, so a future hash migration (BLAKE4, post-quantum, …) needs no flag day: new writes carry a new tag and old reads still parse. BLAKE3 is the only function today; adding one is the only change a migration requires here.
Variants§
Blake3
BLAKE3-256. Multicodec 0x1e, 32-byte digest.
Implementations§
Source§impl HashFn
impl HashFn
Sourcepub const fn multicodec(self) -> u64
pub const fn multicodec(self) -> u64
Multicodec code (encoded as an unsigned-varint in the binary multihash).
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
Short tag used in the self-describing string form <fn>:<hex>.
Sourcepub const fn digest_len(self) -> usize
pub const fn digest_len(self) -> usize
Digest length in bytes.
Trait Implementations§
impl Copy for HashFn
impl Eq for HashFn
impl StructuralPartialEq for HashFn
Auto Trait Implementations§
impl Freeze for HashFn
impl RefUnwindSafe for HashFn
impl Send for HashFn
impl Sync for HashFn
impl Unpin for HashFn
impl UnsafeUnpin for HashFn
impl UnwindSafe for HashFn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more