title: IPv6 address entropy and hashing
body: <p>I have one thread that delegates incoming IPv6 connections to X worker threads, where connections with the same IPv6 source address should always be sent to the same worker thread. However, given a large amount of connections from all over the Internet, I also want to minimize the differences in load all X worker threads have to take on (i.e. in any given large time interval all worker threads should be entrusted with connections with approximately the same number of unique IPv6 addresses).</p>
  
  <p>The most naive way to do so would be to interpret all or a section of the IPv6 address as a number N, and send it to the worker thread with index [N mod X]. However, IP addresses have low entropy (i.e. some bits are (un)set more often than others and thus are quite unrandom), so that would result in poor load balancing among the worker threads.</p>
  
  <p>Clearly some kind of low-cost hashing needs to performed on the addresses to get keys with higher entropy. So are there documented solutions for this problem? Doesn't need to result in fantastic randomness, just something known to work reasonably well with IPv6 addresses.</p>
  
  <p><em>Edited to remove the sentence about avoiding collisions (because in this scenario, collisions are actually totally fine).</em></p>