lincount.murmurhash

Computes MurmurHash hashes of arbitrary data. MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup. This module conforms to the APIs defined in std.digest.digest. This module publicly imports std.digest.digest and can be used as a stand-alone module. Note: The current implementation is optimized for little endian architectures. It will exhibit different results on big endian architectures and a slightly less uniform distribution.

Public Imports

std.digest.digest
public import std.digest.digest;

Members

Aliases

MurmurHash3_x64_128
alias MurmurHash3_x64_128 = Piecewise!SMurmurHash3_x64_128

Implements MurmurHash3_x64_128 std.digest.digest Template API.

MurmurHash3_x64_128Digest
alias MurmurHash3_x64_128Digest = WrapperDigest!MurmurHash3_x64_128

Implements MurmurHash3_x64_128 std.digest.digest.Digest OOO API.

MurmurHash3_x86_128
alias MurmurHash3_x86_128 = Piecewise!SMurmurHash3_x86_128

Implements MurmurHash3_x86_128 std.digest.digest Template API.

MurmurHash3_x86_128Digest
alias MurmurHash3_x86_128Digest = WrapperDigest!MurmurHash3_x86_128

Implements MurmurHash3_x86_128 std.digest.digest.Digest OOO API.

MurmurHash3_x86_32
alias MurmurHash3_x86_32 = Piecewise!SMurmurHash3_x86_32

Implements MurmurHash3_x86_32 std.digest.digest Template API.

MurmurHash3_x86_32Digest
alias MurmurHash3_x86_32Digest = WrapperDigest!MurmurHash3_x86_32

Implements MurmurHash3_x86_32 std.digest.digest.Digest OOO API.

Functions

checkResult
void checkResult(string[string] groundtruth)
Undocumented in source. Be warned that the author may not have intended to support it.
fmix
ulong fmix(ulong k)
Undocumented in source. Be warned that the author may not have intended to support it.
fmix
uint fmix(uint h)
Undocumented in source. Be warned that the author may not have intended to support it.
getBytes
auto getBytes(H hash)

Returns the current hashed value as an ubyte array.

hash
auto hash(string data)
Undocumented in source. Be warned that the author may not have intended to support it.
putBlocks
void putBlocks(H hasher, const(Block[]) blocks)

Pushes an array of blocks at once. It is more efficient to push as much data as possible in a single call. On platform that does not support unaligned reads (some old ARM chips), it is forbidden to pass non aligned data.

rotl
T rotl(T x, uint y)
Undocumented in source.
shuffle
T shuffle(T k, T c1, T c2, ubyte r1)
Undocumented in source. Be warned that the author may not have intended to support it.
update
void update(T h, T k, T mixWith, T c1, T c2, ubyte r1, ubyte r2, T n)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Piecewise
struct Piecewise(Hasher)
Undocumented in source.
SMurmurHash3_x64_128
struct SMurmurHash3_x64_128

MurmurHash3 for x86_64 processors producing a 128 bits value. This is a lower level implementation that makes finalization optional and have slightly better performance. Note that putRemainder can be called only once and that no subsequent calls to putBlocks is allowed.

SMurmurHash3_x86_128
struct SMurmurHash3_x86_128

MurmurHash3 for x86 processors producing a 128 bits value. This is a lower level implementation that makes finalization optional and have slightly better performance. Note that putRemainder can be called only once and that no subsequent calls to putBlocks is allowed.

SMurmurHash3_x86_32
struct SMurmurHash3_x86_32

MurmurHash3 for x86 processors producing a 32 bits value. This is a lower level implementation that makes finalization optional and have slightly better performance. Note that putRemainder can be called only once and that no subsequent calls to putBlocks is allowed.

Templates

bits
template bits(T)
Undocumented in source.

Meta

Authors

Guillaume Chatelet References: Reference implementation
Wikipedia on MurmurHash