Trait Hash

Source
pub trait Hash:
    Default
    + Clone
    + Eq
    + PartialEq {
    // Required methods
    fn hash(data: &[u8]) -> Self;
    fn to_string(hash: &Self) -> String;
}
Expand description

trait to define different hash function

Required Methods§

Source

fn hash(data: &[u8]) -> Self

Source

fn to_string(hash: &Self) -> 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§