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§
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<D: Digestible> Digestible for [D]
impl<D: Digestible> Digestible for [D]
Source§fn digest<S: Sha256>(&self) -> Digest
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.