Digest

Trait Digest 

Source
pub trait Digest {
    const NAME: &'static str;

    // Required methods
    fn digest(&mut self, input: &[u8]) -> String;
    fn update(&mut self, input: &[u8]);
    fn verify(&mut self, encoded: &str) -> bool;
}
Expand description

Describes computing message digests for arbitrary bytes

This trait has notable implementations such as apub-openssl’s OpenSslDigest, and apub-rustcrypto’s Sha256Digest

Required Associated Constants§

Source

const NAME: &'static str

This NAME should correspond with an HTTP Digest algorithm name

Required Methods§

Source

fn digest(&mut self, input: &[u8]) -> String

Produce a message digest from the given bytes

Source

fn update(&mut self, input: &[u8])

Update the Digest with the given bytes

Source

fn verify(&mut self, encoded: &str) -> bool

Verify an encoded string with the current digest

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.

Implementations on Foreign Types§

Source§

impl<'a, T> Digest for &'a mut T
where T: Digest,

Source§

const NAME: &'static str = T::NAME

Source§

fn digest(&mut self, input: &[u8]) -> String

Source§

fn update(&mut self, input: &[u8])

Source§

fn verify(&mut self, encoded: &str) -> bool

Source§

impl<T> Digest for Box<T>
where T: Digest,

Source§

const NAME: &'static str = T::NAME

Source§

fn digest(&mut self, input: &[u8]) -> String

Source§

fn update(&mut self, input: &[u8])

Source§

fn verify(&mut self, encoded: &str) -> bool

Implementors§