Return-Path: Delivered-To: efg2.com%efg2@efg2.com Received: (cpmta 19450 invoked from network); 16 Aug 2001 06:57:22 -0700 Received: from ronja.se.uu.net (212.209.60.58) by smtp.c007.snv.cp.net (209.228.33.204) with SMTP; 16 Aug 2001 06:57:22 -0700 X-Received: 16 Aug 2001 13:57:22 GMT Received: from matrix.biip.no ([62.70.29.151]) by ronja.se.uu.net (8.9.3/8.9.3) with ESMTP id PAA17825 for ; Thu, 16 Aug 2001 15:57:20 +0200 (MET DST) Message-Id: <5.0.0.25.2.20010816155346.00bbea00@pop.biip.no> X-Sender: tedt@pop.biip.no X-Mailer: QUALCOMM Windows Eudora Version 5.0 Date: Thu, 16 Aug 2001 15:59:50 +0100 To: "Earl F. Glynn" From: Ted =?iso-8859-1?Q?T=F8raasen?= Subject: Re: Computer Lab Feedback In-Reply-To: <003001c105cf$793c7920$0200a8c0@DELL650> References: <5.0.0.25.2.20010705092021.00ba00e0@pop.biip.no> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Status: U X-UIDL: O3vRQ9HkIcxMCAE HI , sorry about this delayed feed back. Regarding the suggestion under, i got it working after making some changes . I changed Nbyte and I to longoword. Same with CRCvalue, but guess this part was not needed. All in all it solved my problem , thank you very much. You may wanne oppdate the code on the web in case anyone else tries to use the code. Again Thank you Kind Regards Ted PROCEDURE CalcCRC16 (p: pointer; nbyte: Longword; VAR CRCvalue: Longword); VAR i: longWORD; // Changed to longword from word q: ^buffer; {The following is a little cryptic (but executes very quickly). The algorithm is as follows: 1. exclusive-or the input byte with the low-order byte of the CRC register to get an INDEX 2. shift the CRC register eight bits to the right 3. exclusive-or the CRC register with the contents of Table[INDEX] 4. repeat steps 1 through 3 for all bytes} BEGIN q := p; FOR i := 1 TO nBYTE DO CRCvalue := Hi(CRCvalue) XOR Table[ q^[i] XOR Lo(CRCvalue) ] END {CalcCRC16}; At 22:55 2001.07.05 -0500, you wrote: >Hi, Ted: > > > I have been working on a project that needed CRC-16 , and used your CRC-16 > > / CRC-32 Calculator code . > > This worked great for a while, but there seems to be some limitation on >the > > length of the string. Atleast I'm told that the crc value is > > invalide (verified by a third party) when the string is longer then a > > limit. No found how long yet but seems to be around 634KB string. > >CRC-16 should fail somewhere around 64K-1 = 65535 bytes. > > > Was > > wondering if this is a limitation of the CR-16 or if there might be an > > error in the source. I'm using D5 sp3. Hope you are able to give me some > > feed back on this. > >The nbyte parameter passed to the CalcCRC16 procedure is a WORD. >This means that only values 0 to 65535 are possible with a WORD. >If you change the type of the nbyte parameter to a DWORD (or a >LongWord), that will allow lengths of about 2 billion bytes. I think >that's all you need to change. > >I hope this gets you going. > >Best wishes, > >-- >efg -- Earl F. Glynn, Overland Park, KS USA >efg's Computer Lab Mirror: http://homepages.borland.com/efg2lab