I am trying to create a hash for a string of 10 or 16 bytes. These strings are either ethernet mac address + ip address (6 + 4 bytes) or just a ipv6 ip (16 bytes).
I would ideally like to keep my cake and eat it. Absolute minimum collisions would be the priority. Hash must be less than 16 bytes long and be fairly quick. < O(n^2)
Any idea to where I should start?
Perhaps I’m missing something, but if your data to hash is no longer than your hash, the obvious candidate is to use the data itself as hash – padded with,say, zeroes if shorter than 16 bytes: I doubt anything could beat that in terms of simplicity or collisions.