pub trait Digest: Debug + Default + Copy + Clone + Eq + PartialEq + Send + Sync + Serializable + Deserializable {
    fn as_bytes(&self) -> [u8; 32];
}
Expand description

Defines output type for a cryptographic hash function.

Required methods

Returns this digest serialized into an array of bytes.

Ideally, the length of the returned array should be defined by an associated constant, but using associated constants in const generics is not supported by Rust yet. Thus, we put an upper limit on the possible digest size. For digests which are smaller than 32 bytes, the unused bytes should be set to 0.

Implementors