Skip to main content

CanonicalDigest

Trait CanonicalDigest 

Source
pub trait CanonicalDigest<const N: usize>: Copy {
    // Required methods
    fn to_canonical(self) -> [u8; N];
    fn from_canonical(bytes: [u8; N]) -> Self;
}
Expand description

A digest a checkpoint stores as its canonical N bytes.

The raw bytes, or a CredentialDigest that wraps 32 of them (PROTO-007 R1). Either encodes to the same bytes, so the capsule format is unchanged.

Required Methods§

Source

fn to_canonical(self) -> [u8; N]

The canonical bytes.

Source

fn from_canonical(bytes: [u8; N]) -> Self

The digest the canonical bytes name.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<const N: usize> CanonicalDigest<N> for [u8; N]

Source§

fn to_canonical(self) -> [u8; N]

Source§

fn from_canonical(bytes: [u8; N]) -> Self

Implementors§

Source§

impl CanonicalDigest<CANONICAL_DIGEST_LEN> for CredentialDigest