Trait Hash

Source
pub trait Hash {
    const CODE: Code;

    // Required method
    fn digest(bytes: &[u8]) -> Multihash;
}
Expand description

Trait for hash type markers.

Required Associated Constants§

Source

const CODE: Code

The multihash code.

Required Methods§

Source

fn digest(bytes: &[u8]) -> Multihash

Computes the multihash of a byte slice.

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§

Source§

impl Hash for Blake2b256

Source§

const CODE: Code = multihash::Code::Blake2b256

Source§

impl Hash for Blake2b512

Source§

const CODE: Code = multihash::Code::Blake2b512

Source§

impl Hash for Blake2s128

Source§

const CODE: Code = multihash::Code::Blake2s128

Source§

impl Hash for Blake2s256

Source§

const CODE: Code = multihash::Code::Blake2s256

Source§

impl Hash for Identity

Source§

const CODE: Code = multihash::Code::Identity

Source§

impl Hash for Keccak224

Source§

const CODE: Code = multihash::Code::Keccak224

Source§

impl Hash for Keccak256

Source§

const CODE: Code = multihash::Code::Keccak256

Source§

impl Hash for Keccak384

Source§

const CODE: Code = multihash::Code::Keccak384

Source§

impl Hash for Keccak512

Source§

const CODE: Code = multihash::Code::Keccak512

Source§

impl Hash for Sha1

Source§

const CODE: Code = multihash::Code::Sha1

Source§

impl Hash for Sha2_256

Source§

const CODE: Code = multihash::Code::Sha2_256

Source§

impl Hash for Sha2_512

Source§

const CODE: Code = multihash::Code::Sha2_512

Source§

impl Hash for Sha3_224

Source§

const CODE: Code = multihash::Code::Sha3_224

Source§

impl Hash for Sha3_256

Source§

const CODE: Code = multihash::Code::Sha3_256

Source§

impl Hash for Sha3_384

Source§

const CODE: Code = multihash::Code::Sha3_384

Source§

impl Hash for Sha3_512

Source§

const CODE: Code = multihash::Code::Sha3_512