summaryrefslogtreecommitdiff
path: root/lib/hash-pjw.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-01-14 12:38:51 +0000
committerBruno Haible <bruno@clisp.org>2003-01-14 12:38:51 +0000
commitab352daed97372060cc038c30f2b6394d8ff1c54 (patch)
tree0ec51664d562986a9645c46c29d13482549c9dcc /lib/hash-pjw.c
parentffdc9a193564452fada6edbf618c901cb9697990 (diff)
downloadgnulib-ab352daed97372060cc038c30f2b6394d8ff1c54.tar.gz
Add comment about low quality of this function.
Diffstat (limited to 'lib/hash-pjw.c')
-rw-r--r--lib/hash-pjw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/hash-pjw.c b/lib/hash-pjw.c
index 141b08b51f..0a14b3e7af 100644
--- a/lib/hash-pjw.c
+++ b/lib/hash-pjw.c
@@ -1,5 +1,5 @@
/* hash-pjw.c -- compute a hash value from a NUL-terminated string.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +22,10 @@
#include "hash-pjw.h"
/* A hash function for NUL-terminated char* strings using
- the method described in Aho, Sethi, & Ullman, p 436. */
+ the method described in Aho, Sethi, & Ullman, p 436.
+ Note that this hash function produces a lot of collisions when used
+ with short strings with very varied bit patterns.
+ See http://www.haible.de/bruno/hashfunc.html. */
unsigned int
hash_pjw (const void *x, unsigned int tablesize)