blob: 03b0f3a0c6146384d101c2d5d4f89c671af3dd2d (
plain) (
tree)
|
|
#ifndef JOVE_LIB_HASH_H
#define JOVE_LIB_HASH_H 1
#include <stdint.h>
static intmax_t
string_hash(const char *str)
{
/* Hash function courtesy of the following website:
* http://www.cse.yorku.ca/~oz/hash.html*/
intmax_t r = 5381;
while (*str) {
r = (r * 33) ^ *(str++);
}
return r;
}
#endif
|