Trait Digest

Source
pub trait Digest<const S: usize>:
    AsRef<[u8]>
    + AsMut<[u8]>
    + From<[u8; S]>
    + Into<[u8; S]>
    + Clone
    + Hash
    + Debug
    + Default
    + Eq
    + Send
    + Sync
    + 'static {
    const SIZE: usize = S;

    // Provided method
    fn wrap(digest: &[u8]) -> Result<Self, Error> { ... }
}
Expand description

Size marker trait. Stack allocated digest trait.

Provided Associated Constants§

Source

const SIZE: usize = S

Size of the digest. Maximum for Some of the Blake family is 2^64-1 bytes

Provided Methods§

Source

fn wrap(digest: &[u8]) -> Result<Self, Error>

Wraps the digest bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const S: usize> Digest<S> for Blake2bDigest<S>

Source§

impl<const S: usize> Digest<S> for Blake2sDigest<S>

Source§

impl<const S: usize> Digest<S> for Blake3Digest<S>

Source§

impl<const S: usize> Digest<S> for IdentityDigest<S>

Source§

const SIZE: usize = S

Source§

impl<const S: usize> Digest<S> for KeccakDigest<S>

Source§

impl<const S: usize> Digest<S> for Sha2Digest<S>

Source§

impl<const S: usize> Digest<S> for Sha3Digest<S>

Source§

impl<const S: usize> Digest<S> for UnknownDigest<S>