Struct deterministic_hash::DeterministicHasher[][src]

pub struct DeterministicHasher<T: Hasher>(_);
Expand description

Wrapper around any hasher to make it deterministic.

use core::hash::Hash;
use crc::crc32::Hasher32;
use deterministic_hash::DeterministicHasher;
let mut hasher = DeterministicHasher::new(crc::crc32::Digest::new(crc::crc32::KOOPMAN));
(0x1337 as usize).hash(&mut hasher);
assert_eq!(hasher.as_inner().sum32(), 2482448842);

Implementations

Trait Implementations

Implementation of hasher that forces all bytes written to be platform agnostic.

Returns the hash value for the values written so far. Read more

Writes some data into this Hasher. Read more

Writes a single u8 into this hasher.

Writes a single u16 into this hasher.

Writes a single u32 into this hasher.

Writes a single u64 into this hasher.

Writes a single u128 into this hasher.

Writes a single usize into this hasher.

Writes a single i8 into this hasher.

Writes a single i16 into this hasher.

Writes a single i32 into this hasher.

Writes a single i64 into this hasher.

Writes a single i128 into this hasher.

Writes a single isize into this hasher.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.