Be the first to rate this file! 2 Downloads (last 30 days) File Size: 2.26 KB File ID: #24076

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.
Please login to add a comment or rating.
Updates
11 May 2009

 - removed debug print statement (oops)
 - tests for type of input, now works for floating point inputs too

Tag Activity for this File
Tag Applied By Date/Time
string Dan Ellis 11 May 2009 11:51:06
hash Dan Ellis 11 May 2009 11:51:06

Contact us at files@mathworks.com