00001 #ifndef __SUPER_FAST_HASH_H 00002 #define __SUPER_FAST_HASH_H 00003 00004 #include <stdio.h> 00005 00006 // From http://www.azillionmonkeys.com/qed/hash.html 00007 // Author of main code is Paul Hsieh 00008 // I just added some convenience functions 00009 // Also note http://burtleburtle.net/bob/hash/doobs.html, which shows that this is 20% faster than the one on that page but has more collisions 00010 00011 unsigned int SuperFastHash (const char * data, int length); 00012 unsigned int SuperFastHashIncremental (const char * data, int len, unsigned int lastHash ); 00013 unsigned int SuperFastHashFile (const char * filename); 00014 unsigned int SuperFastHashFilePtr (FILE *fp); 00015 00016 #endif