tests/utils/hash.c
/* We MUST provide our own hash function. See hash.h.
   Here is djb2 reported by Dan Bernstein in comp.lang.c. */
We MUST provide our own hash function.
We MUST provide our own hash function .
static inline uint32_t stoi_hash(const char *str)
{
    unsigned long hash = 5381;
    int c;
    while ((c = *str++)) hash = ((hash << 5) + hash) + c;
    return hash;
}
static inline uint32_t stoi_hash ( const char * str ) { unsigned long hash = 5381 ; int c ; while ( ( c = * str ++ ) ) hash = ( ( hash << 5 ) + hash ) + c ; return hash ; }
We MUST provide our own hash function.
We MUST provide our own hash function .