Common Lisp Package: CITY-HASH

An implementation of the CityHash family of hash functions.

README:

FUNCTION

Public

CITY-HASH-128 (OCTETS &KEY (START 0) (END (LENGTH OCTETS)))

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8), from index START to index END and returns the 128-bit hash value as two values of type (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

CITY-HASH-128-WITH-SEED (OCTETS X Y &KEY (START 0) (END (LENGTH OCTETS)))

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8), from index START to index END together with seeds X and Y, each of type (UNSIGNED-BYTE 64), and returns the 128-bit hash value as two values of type (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

CITY-HASH-64 (OCTETS &KEY (START 0) (END (LENGTH OCTETS)))

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8) from index START to index END and returns the 64-bit hash value as an (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

CITY-HASH-64-WITH-SEED (OCTETS SEED &KEY (START 0) (END (LENGTH OCTETS)))

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8), from index START to index END together with SEED of type (UNSIGNED-BYTE 64), and returns the 64-bit hash value as an (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

CITY-HASH-64-WITH-SEEDS (OCTETS SEED0 SEED1 &KEY (START 0) (END (LENGTH OCTETS)))

Hashes the contents of OCTETS, a vector of (UNSIGNED-BYTE 8), from index START to index END together with seeds SEED0 and SEED1, each of type (UNSIGNED-BYTE 64), and returns the 64-bit hash value as an (UNSIGNED-BYTE 64). START defaults to zero, while END defaults to the length of OCTETS.

Private

CITY-MURMUR (OCTETS X Y START LENGTH)

Returns a 128-bit hash code. Based on City and Murmur128.

Undocumented

HASH-LENGTH-0-TO-16 (OCTETS INDEX LENGTH)

HASH-LENGTH-16 (U V)

HASH-LENGTH-17-TO-32 (OCTETS INDEX LENGTH)

HASH-LENGTH-33-TO-64 (OCTETS INDEX LENGTH)

ROTATE-RIGHT-64 (X SHIFT)

SHIFT-MIX (X)

UB32REF/LE (VECTOR INDEX)

UB64REF/LE (VECTOR INDEX)

WEAK-HASH-LENGTH-32-WITH-SEEDS (OCTETS INDEX A B)

MACRO

Private

Undocumented

INCF64 (PLACE DELTA)

MOD-2^64 (X)

U64* (X Y)

U64+ (X Y)

U64- (X Y)

CONSTANT

Private

Undocumented

+EMPTY-OCTET-VECTOR+

+K+

+K0+

+K1+

+K2+

+K3+