MCPcopy Create free account
hub / github.com/apache/httpd / hash_inaddr

Function hash_inaddr

server/vhost.c:352–356  ·  view source on GitHub ↗

This hashing function is designed to get good distribution in the cases * where the server is handling entire "networks" of servers. i.e. a * whack of /24s. This is probably the most common configuration for * ISPs with large virtual servers. * * NOTE: This function is symmetric (i.e. collapses all 4 octets * into one), so machine byte order (big/little endianness) does not matter. * * H

Source from the content-addressed store, hash-verified

350 * Hash function provided by David Hankins.
351 */
352static APR_INLINE unsigned hash_inaddr(unsigned key)
353{
354 key ^= (key >> 16);
355 return ((key >> 8) ^ key) % IPHASH_TABLE_SIZE;
356}
357
358static APR_INLINE unsigned hash_addr(struct apr_sockaddr_t *sa)
359{

Callers 1

hash_addrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected