mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
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:
parent
f7a31ab004
commit
774dadfe9a
7 changed files with 11 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue