<div dir="ltr">I'm going to increase the size of the hash table to 499 (that is apparently prime) from the existing 32 (which isn't).<div>The code should at some point be changed to resize dynamically; later, much later.</div><div><br></div><div>I'm also looking at the hashes where we hash the following:</div><div><br></div><div>- serialno - serialno % table-size is good enough (this is new)</div><div><br></div><div>- pid - pid % table-size is good enough (this is even more new)</div><div><br></div><div>- icookie+zero-cookie (we probably shouldn't include the zero-cookie in the hash but it should do no harm :-)</div><div>- icookie+rcookie</div><div><br></div><div>these use: </div><div><br></div><div><div>        for (j = 0; j < COOKIE_SIZE; j++)</div><div>                i = i * 407 + icookie[j] + rcookie[j];</div></div><div><br></div><div>where 407 isn't prime (does anyone know where 407 came from? if not I'll change that to a prime 521 which I'm choosing randomly) and I'll change the math to:</div><div><br></div><div>      i * 521 + icookie << 8 + rcookie</div><div><br></div><div>So that we don't allow the cookies to cancel out (I could reply with rcookie = 255 - icookie making the hash very non-random),</div><div><br></div><div>Andrew</div><div><br></div><div>PS: I suspect ideal is icookie|rcookie % table-size but what ever</div><div><br></div></div>