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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.59.5.68 with SMTP id ck4mr1727287ved.9.1383248766460; Thu, 31 Oct 2013 12:46:06 -0700 (PDT) X-Received: by 10.49.97.37 with SMTP id dx5mr59015qeb.39.1383248766441; Thu, 31 Oct 2013 12:46:06 -0700 (PDT) Path: border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!proxad.net!feeder2-2.proxad.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.112.MISMATCH!peer02.iad.highwinds-media.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!o2no12693164qas.0!news-out.google.com!9ni2504qaf.0!nntp.google.com!i2no3707655qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 Oct 2013 12:46:06 -0700 (PDT) In-Reply-To: <87a31163-91a2-471a-9b98-8f5b1414037e@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 References: <87a31163-91a2-471a-9b98-8f5b1414037e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <579437d2-b330-46b2-90cd-0c3b8fcd43ac@googlegroups.com> Subject: Re: FNV-1 From: sbelmont700@gmail.com Injection-Date: Thu, 31 Oct 2013 19:46:06 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2558 X-Received-Body-CRC: 201683097 Date: 2013-10-31T12:46:06-07:00 List-Id: On Wednesday, October 30, 2013 8:03:11 PM UTC-4, Adam Beneschan wrote: >=20 > Since FNV_Offset_Subtype doesn't have negative values, this would make it= seem that FNV_Offset_Type'Size is more likely to be 31, 63, 127, etc., ins= tead of 32, 64, 128, etc., if the Implementation Advice is followed. Or it= could be something totally different depending on how FNV_Hash_Type'Last i= s defined. Those would play havoc with the definition of K_Offset. I'm no= t sure how to fix this portably. >=20 I was considering this, but convinced myself that since everything is still= a modulus type, the extra bit would be required for the entire range (i.e.= if you need 32 bits to hold 0..2**32-1, then you still need all 32 bits fo= r 1..2**32-1). I played around with a few different sizes, and GNAT seemed= to give errors (and warnings) where needed, so I sort of let it lie. As l= ong non-powers of two end up with errors and warnings, I guess that's the i= mportant part. I also tried to do it using the actual 'Modulus, however, I ran into overfl= ows for the larger numbers using 32-bit compilers, and couldn't figure out = a slick way to do an lg statically. Thank you for your response. I welcome any more suggestions or advice. -sb