Change bloom filter's dependence on size_t.

That type can vary across platforms, but factored in to a bloom
filter's internal state, e.g. size of the seed.
This commit is contained in:
Jon Siwek 2013-08-16 12:39:21 -05:00
parent f7a31ab004
commit 774dadfe9a
7 changed files with 11 additions and 13 deletions

View file

@ -10,7 +10,7 @@
using namespace probabilistic;
size_t Hasher::MakeSeed(const void* data, size_t size)
uint64_t Hasher::MakeSeed(const void* data, size_t size)
{
u_char buf[SHA256_DIGEST_LENGTH];
SHA256_CTX ctx;
@ -29,7 +29,7 @@ size_t Hasher::MakeSeed(const void* data, size_t size)
}
sha256_final(&ctx, buf);
return *reinterpret_cast<size_t*>(buf); // Use the first bytes as seed.
return *reinterpret_cast<uint64_t*>(buf); // Use the first bytes as seed.
}
Hasher::digest_vector Hasher::Hash(const HashKey* key) const