Digestible

Trait Digestible 

Source
pub trait Digestible {
    // Required method
    fn digest<S: Sha256>(&self) -> Digest;
}
Expand description

Defines a collision resistant hash for the typed and structured data.

Required Methods§

Source

fn digest<S: Sha256>(&self) -> Digest

Calculate a collision resistant hash for the typed and structured data.

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 Digestible for Vec<u8>

Source§

fn digest<S: Sha256>(&self) -> Digest

Source§

impl Digestible for [u8]

Source§

fn digest<S: Sha256>(&self) -> Digest

Source§

impl<D: Digestible> Digestible for [D]

Source§

fn digest<S: Sha256>(&self) -> Digest

A default incremental hashing algorithm for a slice of Digestible elements.

This hashing routine may not be appropriate for add use cases. In particular, it is not a PRF and cannot be used as a MAC. Given a digest of a list, anyone can compute the digest of that list with additional elements appended to the front of the list. It also does not domain separate typed data, and the digest of an empty slice is the zero digest.

Source§

impl<T: Digestible> Digestible for Option<T>

Source§

fn digest<S: Sha256>(&self) -> Digest

Implementors§