changeset 4177:6a34d03dc4e3

Add comment about low quality of this function.
author Bruno Haible <bruno@clisp.org>
date Tue, 14 Jan 2003 12:38:51 +0000
parents 70678e78cc99
children d600a57046b9
files lib/ChangeLog lib/hash-pjw.c
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+2003-01-11  Bruno Haible  <bruno@clisp.org>
+
+	* hash-pjw.c: Add comment about low quality of this function.
+
 2003-01-12  Paul Eggert  <eggert@twinsun.com>
 
 	Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
--- 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)