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!border2.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread3.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Hashing on System.Address References: <1118699859.296241.40700@g44g2000cwa.googlegroups.com> From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 14 Jun 2005 02:22:07 GMT NNTP-Posting-Host: 24.149.57.125 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.atl.earthlink.net 1118715727 24.149.57.125 (Mon, 13 Jun 2005 19:22:07 PDT) NNTP-Posting-Date: Mon, 13 Jun 2005 19:22:07 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:11329 Date: 2005-06-14T02:22:07+00:00 List-Id: Robert A Duff writes: > "Matthew Heaney" writes: > > Use System.Storage_Elements.To_Integer to convert the address to an > > Integer_Address, and then convert that to type Hash_Type. > > It might be a good idea to divide that by 8, since most addresses have > zeros in the low three bits. Good idea. The other thing I haven't really figured out is what to do if you have a 64-bit address, and Hash_Type is only 32. Ideally you'd like to compute a 32-bit hash value that uses all 64 bits of the address. Alternatively, you could use the ordered container, since type System.Address has a less than ("<") relational operator.