src/lcthw/hashmap.c
static uint32_t default_hash(void *a) {
  size_t len = blength((bstring)a);
  char *key = bdata((bstring)a);
  uint32_t hash = 0;
  uint32_t i = 0;

  for (hash = i = 0; i < len; ++i) {
    hash += key[i];
    hash += (hash << 10);
    hash ^= (hash >> 6);
  }

  hash += (hash << 3);
  hash ^= (hash >> 11);
  hash += (hash << 15);

  return hash;
}
/**
 * Bob jenkins's hash algorithm
 */
Bob jenkins's hash algorithm
Bob jenkins ' s hash algorithm
static uint32_t default_hash(void *a) {
  size_t len = blength((bstring)a);
  char *key = bdata((bstring)a);
  uint32_t hash = 0;
  uint32_t i = 0;
  for (hash = i = 0; i < len; ++i) {
    hash += key[i];
    hash += (hash << 10);
    hash ^= (hash >> 6);
  }
  hash += (hash << 3);
  hash ^= (hash >> 11);
  hash += (hash << 15);
  return hash;
}
static uint32_t default_hash ( void * a ) { size_t len = blength ( ( bstring ) a ) ; char * key = bdata ( ( bstring ) a ) ; uint32_t hash = 0 ; uint32_t i = 0 ; for ( hash = i = 0 ; i < len ; ++ i ) { hash += key [ i ] ; hash += ( hash << 10 ) ; hash ^= ( hash >> 6 ) ; } hash += ( hash << 3 ) ; hash ^= ( hash >> 11 ) ; hash += ( hash << 15 ) ; return hash ; }
Bob jenkins's hash algorithm
Bob jenkins ' s hash algorithm