module watt.digest.murmur

Contains an implementation of the Murmur hashing function.

In particular, the 32 bit variant of the MurmurHash3 algorithm, optimised for little-endian CPUs.

Murmur hash is intended to be fast, while generating hashes with good distribution and hash resistance. It is not appropriate for cryptographic purposes.

See also

Code Map

//! Contains an implementation of the Murmur hashing function.
module watt.digest.murmur;


//! Hash data using the 32 bit Murmur hash, and a seed of 0.
fn hashMurmur_32(arr: const(const(void)[])) u32 { }
//! Hash data using the 32 bit Murmur hash, and a seed.
fn hashMurmur_32(arr: const(const(void)[]), seed: u32) u32 { }
fn hashMurmur_32(arr: const(const(void)[])) u32

Hash data using the 32 bit Murmur hash, and a seed of 0.

Parameters

arr

The data to hash.

Return

A 32 bit unsigned integer containing the calculated hash.

fn hashMurmur_32(arr: const(const(void)[]), seed: u32) u32

Hash data using the 32 bit Murmur hash, and a seed.

Parameters

arr

The data to hash.

seed

A value to add additional randomness to the hashing process.

Return

A 32 bit unsignedf integer containing the calculated hash.