opr: Add Bob Jenkins's hash functions
authorSimon Wilkinson <sxw@your-file-system.com>
Sun, 20 Nov 2011 23:40:51 +0000 (23:40 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 21 Nov 2011 15:45:14 +0000 (07:45 -0800)
commit20448059f02d07eccf7f81fdb55b80e566acfecc
treee129b4b680a0a42bbd101e6bdefe7034da37ff5e
parentf1dd2d696fb9ab71b4192b156042e0c63019c58a
opr: Add Bob Jenkins's hash functions

This imports a small subset of Bob Jenkins lookup3.c hash functions
into the opr library. At present we only import the subset of this
that deals with aligned arrays of integers, as this addresses our
immediate need.

It seems likely that if we're interested in a hash function for string
arrays (or other arbitrary data), that more recent functions such like
SpookyHash (from Bob Jenkins, again) or CityHash (from Google) may be
a better solution.

The immediate use case for this is removing the use of the '%' operator
when indexing speed critical hash tables, as well as ensuring fairer
distribution of entries across these tables.

A short set of test cases is also provided

Change-Id: I0ae26382e77da02204a30a95747f7d6de8c4f24a
Reviewed-on: http://gerrit.openafs.org/6095
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
src/opr/Makefile.in
src/opr/NTMakefile
src/opr/jhash.h [new file with mode: 0644]
tests/TESTS
tests/opr/.gitignore
tests/opr/Makefile.in
tests/opr/jhash-t.c [new file with mode: 0644]