Hi all,<div><br></div><div>I was looking at the code in ngx_http_upstream_ip_hash_module.c</div><div>And I'm not sure where the hashing algorithm for IPs is coming from, especially those lines :</div><div><br></div><div>
iphp->hash = 89;</div><div><br></div><div><div> hash = (hash * 113 + iphp->addr[i]) % 6271;</div></div><div><br></div><div>Just wondering if those constants are arbitrary chosen, or if there is something there to guarantee a good distribution ?</div>
<div><br></div><div>If you have some links explaining this algorithm, it would be greatly appreciated!</div><div>Also, how would you get a good distribution on IPv6. Maybe it would make sense to use murmur ?</div><div><br>
</div><div>Thank you,</div><div><br></div><div>Matthieu.</div>