summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-11-25 06:30:24 -0800
committerEric Anholt <eric@anholt.net>2009-11-25 06:33:00 -0800
commit5997320dcae4d48c98f403b158b7f7be2d3022fd (patch)
treefa85d1121286c86da265426a6c120a9b3ec054af
parent1a26ea651b03759c8b5ba98dd8fc81aae227fbc9 (diff)
fnv1a: use the correct offset basis so that 0-filled buffers hash by length.
Reported by: Chris Wilson
-rw-r--r--fnv_hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fnv_hash.c b/fnv_hash.c
index 47bae03..d34bf81 100644
--- a/fnv_hash.c
+++ b/fnv_hash.c
@@ -38,7 +38,7 @@
uint32_t
fnv1_hash_string(const void *key)
{
- uint32_t hash = 0;
+ uint32_t hash = 2166136261ul;
const unsigned char *str = key;
while (*str != 0) {