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.236.129.194 with SMTP id h42mr2866083yhi.11.1383251759895; Thu, 31 Oct 2013 13:35:59 -0700 (PDT) X-Received: by 10.182.47.161 with SMTP id e1mr68926obn.24.1383251759860; Thu, 31 Oct 2013 13:35:59 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!o2no12762187qas.0!news-out.google.com!9ni3693qaf.0!nntp.google.com!i2no3776561qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 Oct 2013 13:35:58 -0700 (PDT) In-Reply-To: <579437d2-b330-46b2-90cd-0c3b8fcd43ac@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: <87a31163-91a2-471a-9b98-8f5b1414037e@googlegroups.com> <579437d2-b330-46b2-90cd-0c3b8fcd43ac@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: FNV-1 From: Adam Beneschan Injection-Date: Thu, 31 Oct 2013 20:35:59 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17566 Date: 2013-10-31T13:35:58-07:00 List-Id: On Thursday, October 31, 2013 12:46:06 PM UTC-7, sbelm...@gmail.com wrote: > On Wednesday, October 30, 2013 8:03:11 PM UTC-4, Adam Beneschan wrote: >=20 > >=20 >=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., i= nstead 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= is defined. Those would play havoc with the definition of K_Offset. I'm = not sure how to fix this portably. >=20 > >=20 >=20 >=20 >=20 > I was considering this, but convinced myself that since everything is sti= ll 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 = for 1..2**32-1). I played around with a few different sizes, and GNAT seem= ed to give errors (and warnings) where needed, so I sort of let it lie. As= long non-powers of two end up with errors and warnings, I guess that's the= important part. You're right, I missed that the base type is a modular type. (I've had lot= s of problems with 'Size of subtypes of signed integer types, which is why = the code raised red flags with me ... but I forgot to check that. Sorry.) -- Adam