Boost logo

Boost :

Subject: Re: [boost] [hash] Extract module from functional + std::hash_combine
From: Peter Dimov (lists_at_[hidden])
Date: 2018-01-06 18:00:59


Bjorn Reese wrote:

> On 01/06/18 17:26, Peter Dimov via Boost wrote:
>
> > https://github.com/pdimov/hash2
>
> Splendid.
>
> Would it be possible to add configurable hash functions (or make some of
> the existing ones configurable?)

If by configurable you mean hash functions that can take a seed, yes, the
provided hash functions do have constructors taking seeds, matching their
"canonical" implementations. spooky2_128's constructor, for example, is

    explicit spooky2_128( boost::uint64_t seed1 = 0, boost::uint64_t seed2 =
0 );

and murmur3_32 has

    explicit murmur3_32( boost::uint32_t seed = 0 );

In addition, all algorithms support

    H( byte_type const * seed, ptrdiff_t n );

as a generic way to supply a seed.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk