Jenkin's "One at a time" hash
by Dan Ellis
10 May 2009
(Updated 11 May 2009)
Simple, high-performance hash to map char strings into 32 bit ints
|
Watch this File
|
| File Information |
| Description |
This is a C mex interface to the "one at a time" string-to-int32 hash function by Bob Jenkins. I found it clumsy to implement this within Matlab, so I implemented it in C.
For information on the hash function, see
http://en.wikipedia.org/wiki/Jenkins_hash_function
http://www.burtleburtle.net/bob/hash/doobs.html
To use the function, first
mex jenkinshash.c
then simply
h = jenkinshash('Some string');
If the argument is a matrix, one hash is returned for each row.
|
| MATLAB release |
MATLAB 7.8 (R2009a)
|
| Other requirements |
mex compiler |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 11 May 2009 |
- removed debug print statement (oops)
- tests for type of input, now works for floating point inputs too |
|
Contact us at files@mathworks.com