nxt.hash_functions

Various hash functions, including integer ones.

Test: dmd -version=show -preview=dip1000 -preview=in -vcolumns -mcpu=native -checkaction=context -debug -g -unittest -main -I.. -i -run hash_functions.d

Members

Aliases

mixHash
alias mixHash = hashCombine
Undocumented in source.

Functions

fibonacciHash
size_t fibonacciHash(hash_t hash)
Undocumented in source.
hashCombine
hash_t hashCombine(hash_t lhs, hash_t rhs)

Combine the hashes lhs and rhs.

hashOfPolymorphic
hash_t hashOfPolymorphic(Class a)

Hash that incorporates the hash of typeid bit-xored with hashOf(a).

hashOfTypeInfoPtr
hash_t hashOfTypeInfoPtr(TypeInfo_Class typeinfo)
Undocumented in source. Be warned that the author may not have intended to support it.
identityHash64
hash_t identityHash64(ulong x)

Dummy-hash for benchmarking performance of HashSet.

lemireHash32
uint lemireHash32(uint x)
Undocumented in source. Be warned that the author may not have intended to support it.
lemireHash32
uint lemireHash32(float x)

Inspired by Lemire's strongly universal hashing.

lemireHash64
hash_t lemireHash64(ulong x)
hash_t lemireHash64(double x)

Inspired by Lemire's strongly universal hashing.

muellerHash32
uint muellerHash32(uint x)

Mueller integer hash function (bit mixer) A (32-bit).

muellerHash64
hash_t muellerHash64(ulong x)

Mueller integer hash function (bit mixer) A (64-bit).

typeidHashOf
size_t typeidHashOf(T x)
wangMixHash64
hash_t wangMixHash64(ulong x)

Thomas Wang 64-bit mix integer hash function.

Meta