Skip to main content

Hasher

Trait Hasher 

Source
pub trait Hasher: Hasher {
    // Required method
    fn finish32(&self) -> u32;
}
Expand description

An extension of core::hash::Hasher for hashers which use 32 bits.

For hashers which implement this trait, the standard finish method should just return a zero-extended version of the result of finish32.

§Contract

Implementers of this trait must not perform any 64-bit (or 128-bit) operation while computing the hash.

Required Methods§

Source

fn finish32(&self) -> u32

The equivalent of core::hash::Hasher.finish for 32-bit hashers.

This returns the hash directly; finish zero-extends it to 64 bits for compatibility.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Hasher for hash32::FnvHasher

Source§

impl Hasher for hash32::Murmur3Hasher