5 /* compute hash value for string
7 /* int hash(string, size)
11 /* This function computes for the given null-terminated string an
12 /* integer hash value in the range 0..size-1.
15 /* Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman: Compilers:
16 /* principles, techniques and tools; Addison-Wesley, Amsterdam, 1986.
19 /* Eindhoven University of Technology
20 /* Department of Mathematics and Computer Science
21 /* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
23 /* Originally written by: P. J. Weinberger at Bell Labs.
30 static char hash_sccsid
[] = "@(#) hash.c 1.1 92/01/15 21:53:12";
32 /* hash - hash a string; original author: P. J. Weinberger at Bell Labs. */
38 register unsigned long h
= 0;
39 register unsigned long g
;
42 * For a performance comparison with the hash function presented in K&R,
43 * first edition, see the "Dragon" book by Aho, Sethi and Ullman.
48 if (g
= (h
& 0xf0000000)) {