summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d5cfcd)
raw | patch | inline | side by side (parent: 0d5cfcd)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 9 Dec 2009 15:30:10 +0000 (16:30 +0100) | ||
committer | Florian Forster <octo@noris.net> | |
Wed, 9 Dec 2009 15:30:10 +0000 (16:30 +0100) |
The previous prime number, 251, did not distribute good enough into
three groups.
three groups.
src/match_hashed.c | patch | blob | history |
diff --git a/src/match_hashed.c b/src/match_hashed.c
index 062a7a7299be36816d6eb64c1773378f9f9842ad..4d5330503bb82399bcd14855fd90ad31e59c90e8 100644 (file)
--- a/src/match_hashed.c
+++ b/src/match_hashed.c
for (host_ptr = vl->host; *host_ptr != 0; host_ptr++)
{
- /* 251 is the largest prime smaller than 256. */
- hash_val = (hash_val * 251) + ((uint32_t) *host_ptr);
+ /* 2184401929 is some appropriately sized prime number. */
+ hash_val = (hash_val * 2184401929) + ((uint32_t) *host_ptr);
}
DEBUG ("hashed match: host = %s; hash_val = %"PRIu32";", vl->host, hash_val);