Common Lisp Package: CL-MURMURHASH

README:

FUNCTION

Public

MAKE-PERFECT-HASH-FUNCTION (VALUES)

Find a perfect seed for VALUES and return a partial application of MURMURHASH to that seed. Return NIL if no perfect seed was found.

MAKE-PERFECT-SEED (VALUES)

Find a seed that ensures every value in VALUES can be hashed without any collisions. Useful when you know a set of values in advance so the hashes can stand for the values. Return NIL if no perfect seed was found.

Private

AVALANCHE (HASH-STATE)

Force bits of HASH-STATE to avalanche.

MIX/32 (HASH-STATE WORD)

Mix WORD and HASH-STATE into a new hash state, then mix that hash state again.

Undocumented

* (A B)

+ (A B)

<< (A S)

^ (A B)

FINALIZE (HASH-STATE LENGTH)

FINALIZE/128 (SEED LENGTH)

FINALIZE/32 (HASH-STATE LENGTH)

HASH-INTEGER (INT SEED)

HASH-INTEGER/128 (INTEGER SEED)

HASH-INTEGER/32 (INTEGER SEED)

HASH-OCTETS (VEC SEED)

HASH-OCTETS/128 (VECTOR SEED)

HASH-OCTETS/32 (VECTOR SEED)

MAKE-SEED

MIX (HASH-STATE WORD)

MIX/128 (SEED WORD)

MIX/128-1 (H1 H2 H3 H4 K1 K2 K3 K4)

SEED (H1 H2 H3 H4 &OPTIONAL (SEED (MAKE-SEED)))

SEEDS (SEED)

SNARF-WORD (STREAM SEQ)

TEST (&KEY ((HASH-SIZE *HASH-SIZE*) 32))

MACRO

Private

Undocumented

*= (PLACE MULTIPLICAND &ENVIRONMENT ENV)

+= (PLACE ADDEND &ENVIRONMENT ENV)

<<= (PLACE ROTATION &ENVIRONMENT ENV)

^= (PLACE INT &ENVIRONMENT ENV)

MIXF (PLACE WORD &ENVIRONMENT ENV)

MIXF32 (PLACE WORD &ENVIRONMENT ENV)

WHILE (TEST &BODY BODY)

GENERIC-FUNCTION

Public

MURMURHASH (OBJECT &KEY (SEED *DEFAULT-SEED*) MIX-ONLY &ALLOW-OTHER-KEYS)

Hash OBJECT using the 32-bit MurmurHash3 algorithm.

VARIABLE

Public

Undocumented

*DEFAULT-SEED*

*HASH-SIZE*

CONDITION

Public

Undocumented

UNHASHABLE-OBJECT-ERROR

CONSTANT

Private

Undocumented

+C1+

+C2+

+C3+

+C4+