From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,eec376a334ad59ed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-06 16:37:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!59ce1190!not-for-mail Message-ID: <3CD71397.E4A89C84@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: hashing References: <1b2t8.507$na.19833@news8-gui.server.ntli.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 06 May 2002 23:36:59 GMT NNTP-Posting-Host: 63.184.23.198 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1020728219 63.184.23.198 (Mon, 06 May 2002 16:36:59 PDT) NNTP-Posting-Date: Mon, 06 May 2002 16:36:59 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:23604 Date: 2002-05-06T23:36:59+00:00 List-Id: Antonio Duran wrote: > > "chris.danx" wrote in message news:<1b2t8.507$na.19833@news8-gui.server.ntli.net>... > > Hi, > > > > Does anyone have a good hash function for strings (length is arbitary, > > number of buckets is determined when package is instantiated and collisions > > are handled with chaining)? I'm new to writing hash tables and functions > > (used them in libs, but this has to be all my own work!), and have chosen > > this technique to implement in an assignment -- had enough linked lists, and > > want to expand my horizons. You might want to look at P. K. Pearson, "Fast Hashing of Variable-Length Text Strings," Comm. ACM, 1990 Jun. It's a fast "hashing function specifically tailored to variable-length text strings." "Similar strings are not likely to collide." It produces an unsigned 8-bit value for the hash. An implementation is available as part of the PragmAda Reusable Components, available from http://home.earthlink.net/~jrcarter010/pragmarc.htm and the mirror at www.adapower.com. Look for PragmARC.Hash_Fast_Variable_Length. -- Jeff Carter "You empty-headed animal-food-trough wiper." Monty Python & the Holy Grail