Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: general hash functions for text: SUMMARY! Message-ID: <3760:Oct1921:09:1190@kramden.acf.nyu.edu> Date: 19 Oct 90 21:09:11 GMT References: <1990Oct19.040234.20794@watmath.waterloo.edu> Organization: IR Lines: 8 In article <1990Oct19.040234.20794@watmath.waterloo.edu> cpshelley@watmsg.waterloo.edu (cameron shelley) writes: > return h & ROOTLEN; /* ROOTLEN must be a power of 2, ie. 2^16 */ Just to make sure it gets said: This should probably be h % ROOTLEN, or h & (ROOTLEN - 1). The latter is faster under most computers and compilers. ---Dan