<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 11 Jun 2011 21:34:13 +0100
From   : info@... (Sprow)
Subject: Calculating CRCs

In article <20110611181321.fwuooeaxcccos4oc@...>,
   J.G.Harston <jgh@...> wrote:
> I found it incredibly difficult tracking down actual working code to
> calculate 32-CRCs as used in ZIP files

There's an implementation in function "asm6502" in my BBC unzip program, and
also "asmarm" for an ARM version. This was a straight port of some C code,
though I don't remember which I wrote first.
It uses the table method to avoid having to thrash the data one bit at a
time, as this will take quite a long time especially on a 6502.

> so after getting code working
> I've put it all together here: http://mdfs.net/Info/Comp/Comms/CRC32.htm

In the C implementation I don't see what

 crc &= 0xFFFFFFFF;

does. You should probably also define poly as 0xEDB88320uL, since it is top
bit set: most compilers will moan about that (and the K&R old style function
prototype!),
Sprow.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>