in reply to Re: computing CRC32 in Perl and C
in thread computing CRC32 in Perl and C

I don't think this is it. I changed from mCrc = crc(s, sizeof(s), mLookup, &mMask); to mCrc = crc(s, sizeof(s)-1, mLookup, &mMask); and now, even though the results are different, they still don't agree.
perl try.pl CRC for 'Hello Word. How are you?' is 0x8487fb61 gcc try.c; ./a.out CRC for 'Hello Word. How are you?' is 0x7b78049e
I have a feeling the problem is the poly, or the reflections, or the initial poly or something like that - I just can't figure out what.

Replies are listed 'Best First'.
Re^3: computing CRC32 in Perl and C
by roboticus (Chancellor) on Dec 13, 2007 at 20:43 UTC
    Okay ... here are a couple other things to try:

    • Are you scanning through the bits in the correct order? I notice you're scanning LSB to MSB . Is that what the CRC wants?
    • Try calculating a single character to see if your initial conditions match up.
    ...roboticus