HashFunction

Trait HashFunction 

Source
pub trait HashFunction {
    type Output;

    // Required method
    fn hash(data: &[u8]) -> Self::Output;
}
Expand description

哈希算法trait,为不同哈希算法提供统一接口

Required Associated Types§

Required Methods§

Source

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

一次性计算哈希

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§