In search of platform independent 128-bit hash function We are currently using murmur3 as our hash function for small strings (up to 128 chars). We plan to replace it with a better non-crypto hash function which is fast and produces unique 128-bit hash for a given input across the platforms (32/64-bit, x86 &amp; arm).

Farmhash could have been an ideal candidate with it's speed and collision resistance but it's quite machine dependent and produces different results on different platform which makes it useless for us.

Cityhash has been known for collision weakness as demonstrated by siphash. So it's out of considerations.

Siphash is too slow and so is Highway hash which appears to be derivative of siphash (feel free to correct)

metrohash, xxhash, and seahash are under considerations.

I wouldn't be bothered by minor difference in speed. However, uniqueness across platform and collision resistance are main criterions.

Please suggest.
If the space of inputs is predetermined before you deploy your system, you can create a perfect hash that is very fast to evaluate and guarantees unique hash values, such as with gperf or nbperf.

If the space of inputs is chosen by a non-adaptive adversary—i.e., an adversary picks a set of keys and then feeds them all to your system at once without picking some keys based on how the system reacted to others—then you can pick some (almost-)universal hash family such as Poly1305 with a secret key you choose uniformly at random: for any pair of inputs, the probability over all possible keys that the inputs collide is $O(1/m)$, where $m$ is the number of possible hash values.

If the space of inputs is chosen by an adaptive adversary and Siphash is too slow, you will need to describe your performance budget in more detail:


How many keys do you have?
What is the distribution of key lengths?
How many cycles per byte can you afford?
How many cycles per key can you afford?
How many bytes can you afford to transmit/store?
What is the cost of a collision?  Of $n$ collisions?


(Transmitting 8 bytes on a network is not free!  Exercise for the reader: How many nanoseconds and joules does it take to compute Siphash on a 16-byte input on your laptop's CPU, and how many nanoseconds and joules does it take your  laptop's ethernet phy to transmit 8 bytes?)