filehash/ffdb_hash.c
unsigned int
_ffdb_call_hash (ffdb_htab_t* hashp, const void* k, unsigned int len)
{
  unsigned int n, bucket;

  n = hashp->hash (k, len);
  bucket = (n & hashp->hdr.high_mask); /* n mod 2^(i + 1) */

  if (bucket > hashp->hdr.max_bucket) {
    bucket = (n & hashp->hdr.low_mask); /* n mod 2^i */
  }

  return bucket;
}
/**
 * One of the most important function: hash function
 * return bucket number
 */
One of the most important function: hash function
return bucket number
One of the most important function : hash function return bucket number
unsigned int
_ffdb_call_hash (ffdb_htab_t* hashp, const void* k, unsigned int len)
{
  unsigned int n, bucket;
  n = hashp->hash (k, len);
  bucket = (n & hashp->hdr.high_mask); 
  if (bucket > hashp->hdr.max_bucket) {
    bucket = (n & hashp->hdr.low_mask); 
  }
  return bucket;
}
unsigned int _ffdb_call_hash ( ffdb_htab_t * hashp , const void * k , unsigned int len ) { unsigned int n , bucket ; n = hashp -> hash ( k , len ) ; bucket = ( n & hashp -> hdr . high_mask ) ; if ( bucket > hashp -> hdr . max_bucket ) { bucket = ( n & hashp -> hdr . low_mask ) ; } return bucket ; }
One of the most important function: hash function
 return bucket number
One of the most important function : hash function return bucket number
/* n mod 2^(i + 1) */ /* n mod 2^i */