Trait Digest

Source
pub trait Digest: Display {
    // Provided methods
    fn as_bytes(&self) -> &[u8] 
       where Self: AsRef<[u8]> { ... }
    fn to_hex_lowercase(&self) -> String
       where Self: LowerHex { ... }
    fn to_hex_uppercase(&self) -> String
       where Self: UpperHex { ... }
}
Expand description

A trait for hash digests.

This trait defines the common interface for hash digests, providing methods for converting the digest into various representations.

Provided Methods§

Source

fn as_bytes(&self) -> &[u8]
where Self: AsRef<[u8]>,

Returns the digest as a byte slice.

Source

fn to_hex_lowercase(&self) -> String
where Self: LowerHex,

Returns the digest as a lowercase hexadecimal string.

Source

fn to_hex_uppercase(&self) -> String
where Self: UpperHex,

Returns the digest as an uppercase hexadecimal string.

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§