title: mapping arbitrary IPv6 addresses to individual RIRs (ARIN, RIPE, etc.)
body: <p>It's easy to map IPv4 addresses to their controlling RIR (ARIN, RIPE, etc.) since v4 addresses are handed out by IANA in blocks of /8 .  I can write a function that takes an arbitrary IPv4 address and figures out the proper RIR simply by examining the first eight bits of that address.</p>
  
  <p>According to <a href="http://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.txt" rel="nofollow">http://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.txt</a> though, global unicast IPv6 addresses are being handed out in blocks of different sizes.  I can't see any rhyme or reason for why these blocks have been allocated in the sizes they have.  This might make it a chore to write an IPv6 version of the above function.</p>
  
  <p>Is there an easy way to tell which (global unicast) IPv6 address belongs to which RIR?  Or will I have to iterate over all assigned netblocks and see if my address is covered by one of them?</p>
  
  <p>thanks!</p>