PDA

View Full Version : Differing CRC32 values on same file



NewsArchive
11-07-2006, 05:16 AM
Hi Friedrich

Not important, but I am wondering why there is a difference in two CRC values.

I see that SB5 reports the CRC32 of the files in the setup package.

I have built a small app to calculate the CRC32 value of a file I include.

My app uses the built in CW6.3 CRC32 function.
I read the whole file into a string, check its length is correct, then pass it to the
SV CRC32 function.

There is a difference in the two values calculated for the same file...

From SB5 I get 35,499,341

From the CW app, I get 967,552,063

Is this difference to be expected?

Is it just that two different CRC32 libraries may be used?

Thanks

John Griffiths

NewsArchive
11-07-2006, 05:16 AM
Hi John,

Please zip the file and let me know what CRC-32 WinZip reports.

Friedrich

--
Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 5

NewsArchive
11-07-2006, 05:17 AM
Hi John,

Just checked this here. I am using the Get File Information(File CRC-32) on
the sbkernel.lib (build 1666) located in the SB5 \Bin32 folder.

Both WinZip and SetupBuilder installers report an e8ac7a27 CRC-32 here on
our machines.

Friedrich

NewsArchive
11-07-2006, 05:17 AM
Hi Friedrich

Strange... I downloaded Winzip and installed... (I use PK for Windows and it does not
show CRC ) and in Winzip I get the same as you for the sbkernel.lib (build 1666)
file, but in my app using the CW CRC32...



MODULE('Clarion')
CRC32(UNSIGNED pBuffer, LONG cbBuffer, LONG InitalCRC),LONG,NAME('CLA$CRC32')
END

I get a different value. I will go back to my app and see if I am doing anything
wrong. It may be that the SV CLA$CRC32 function differes from any "standard" that
may be in place.

I will investigate CRC32 some more, and perhaps find a C library to test with so that
I can get a match with that reported by SB5 and Winzip.

I will let you know how I get on. Maybe I will post something on the Clarion Language
group...

Regards

John Griffiths

NewsArchive
11-07-2006, 09:05 AM
Hi Friedrich

Update on CRC differences...

The inbuilt (and un-documented) CW CRC32 function may have a limit on the size of the
data being CRC'd...

I added some C Source code to do the CRC32 calculation, and after some trial and
error, the result now matches that from SB5 and WinZip.

Regards

John Griffiths

NewsArchive
11-07-2006, 09:05 AM
Hi John,

Thanks for the update.

Friedrich