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,795de96bd314bc93 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-01 22:22:01 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!dispose.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!zap!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: function hash Date: 31 May 2001 20:21:17 +0100 Organization: CodeFella Message-ID: References: <3b117b26_3@news.arrakis.es> <3B11F48A.F018909F@acm.org> <87u2225zsn.fsf@deneb.enyo.de> <3B159410.5532C587@acm.org> <87hey20yqm.fsf@deneb.enyo.de> NNTP-Posting-Host: localhost X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 X-Trace: news.demon.co.uk 991459266 nnrp-02:21310 NO-IDENT pogner.demon.co.uk:158.152.70.98 X-Complaints-To: abuse@demon.net NNTP-Posting-Date: 31 May 2001 19:21:17 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:8009 Date: 2001-05-31T19:21:17+00:00 List-Id: Florian Weimer writes: > Jeffrey Carter writes: > > > Florian Weimer wrote: > > > > > > A hash function returning only 256 different values? Are there any > > > applications for it? > > > > Given the original poster's requirements of handling 500-1000 elements, > > that's only 2-4 per bin, so it seemed suitable. > > In particular with long strings, this will result in a measurable > performance degradation in comparison to a real hash function because > of the necessity to perform additional key comparisons. I don't understand. If there are only 256 bins (not unreasonable) then there are *bound* to be collisions for a large key space (eg all the sentences in Jane Eyre). If you need a perfect hash (eg for the reserved words in Ada) that's quite a different problem.