We are trying to implement a lngest prefix match of IPv6 addresses. What is the best way to represent IPv6 addresses to perform this computation (Longest Prefix match) efficiently.
IPv6 addresses are usually represented in Array[Byte]. (IPv6 addresses are usually represented in Array[Byte] [16]).
And to find a longest prefix match we need to convert the addresses to BitSet (or some sort of array representation of bits) and then find out the longest prefix.
New to this level of stack, and wondering if there is anything I am missing.
Any pointers that would help me move in right direction is highly appreciated.
FYI, this is on Scala. (So any JVM related pointers would be helpful)