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-Thread: 103376,14be6619f79b4573 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Tue, 14 Jun 2005 15:00:57 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <42AE9AD6.80803@mailinator.com> Subject: Re: Hashing on System.Address Date: Tue, 14 Jun 2005 15:03:23 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-KKo1SEzQ6/lzUgO9v28XEhvBAUOvOeU4RlZ0FcWUjQOunT+FhOVhUn0YxI4DDIxTRTFdC5RWIUftubz!CjCQ6yLW3UjnJYaLri/IRI9EFcZ9eiaTgDLQW+2F7MlruO786Dt8Nvb1t0CA+ev6clQPD0SmUjM6 X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:11356 Date: 2005-06-14T15:03:23-05:00 List-Id: "Duncan Sands" wrote in message news:mailman.25.1118740226.17633.comp.lang.ada@ada-france.org... > > > By the way, is there any reason why Ada.Containers doesn't provide some > > > standard hash functions? I reckon hashing on strings and on addresses > > > would be pretty handy. > > > > Out of Containers hierarchy: Ada.Strings.Hash > > You know, this implementation advice sounds pretty silly: > > Implementation Advice > 7/2 > The various Hash functions should be good hash functions, returning a wide spread of values for different string values. It should be unlikely for similar strings to return the same value. > > As if any implementor needs to be told that they should use a "good" rather than a "bad" > hash function! We'd have preferred to say something stronger, and normatively, but there doesn't seem to be a way to describe what a hash function does, other than returning a value of Hash_Type that depends of the argument. So we use IA to describe what the intent is; IA can be informal and use undefined terms like "good". Without the IA, the only indication that this is a hash function is the name. That wouldn't be enough. And if you don't know what a hash function is, the IA will be helpful. Randy.