2 ms·
If you're curious on how to avoid this in your applications, take a look at universal hashing: https://en.wikipedia.org/wiki/Universal_hashing https://en.wikipe
by saagarjha 7y ago
If you're curious on how to avoid this in your applications, take a look at universal hashing: https://en.wikipedia.org/wiki/Universal_hashing https://en.wikipedia.org/wiki/Universal_hashing
- jontro 7y agoHow does that prevent the result being 0? Seems like an implementation detail easily fixed as the author explains.
- saagarjha 7y agoWell, there's two issues here. One is that zero is both a valid hash and a sentinel, which is a Java implementation problem. The other issue is that an attacker can pick a bunch of things that hash to zero and gum up your application's performance, which is what universal hashing solves.