[cfe-dev] [libcxx] Extending the behavior of std::hash in libc++

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Wed Dec 9 02:08:15 PST 2015

On Tue, Dec 08, 2015 at 11:33:19PM -0800, Justin Lebar via cfe-dev wrote:
> But in practice we're not usually interested in exploring the full
> range of possible hashers, especially given that flooding protection
> is already being taken care of by randomizing at startup.  If you know
> you'll need n different hashers, is it not sufficient to seed with
> values in the range [0, n)?

No. Depending on the specific context, you want either a family of
Universal Hash Functions or even pairwise independent hash functions.
That's a lot stronger than just n different hash functions and whether
hash combining is enough to qualify is quite questionable.


More information about the cfe-dev mailing list