Boost logo

Boost Users :

Subject: Re: [Boost-users] [hash] Reliability of hash_value() for std::string
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2012-02-21 09:08:25


Hey,

W dniu 21 lutego 2012 14:27 u¿ytkownik Daniel James <dnljms_at_[hidden]> napisa³:
> On 21 February 2012 12:32, Szymon Gatner <szymon.gatner_at_[hidden]> wrote:
>>
>
> Yes. I assume you've seen this:
>
> http://www.boost.org/libs/crc/
>
> Although you might consider a stronger hash function.
>

Thanks a lot for detailed answer. Another question then:
is computed CRC32 value good hash_value() for unorderd containers?

I mean: say I have a ClassInfo class that keeps the name (string) and a hash
(computed by crc algo) will that work fine (distribution-wise)?

size_t hash_value(const ClassInfo& info)
{
  return info.crcHash_;
}

Cheers,
Simon


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net