Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Note that "fixes bad distributions" is the same thing as "causes bad distributions" if your input is untrusted (or even if you're just unlucky). Especially when you are deliberately choosing a bijective function and it is trivial for an attacker to generate "unfortunate" hashes.

The usual trie tricks can avoid this problem without letting the worst case happen. But as often, adding the extra logic can mean worse performance for non-worst-case input.



You could also use a random salt (for i64, add it up with wrap around overflow) with minimal overhead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: