3

I'm using fsum to generate crc32 checksums of various files. I'd like to validate it's checksums by hand to ensure that they are being calculated correctly, but I don't know how to do this.

I do realize there are programs out there that will check these things for me, but then I'd also have to validate THOSE programs.

Can someone help me figure out how to calculate the crc32 checksums of a file by hand? For the sake of being on the same page, let's use this txt file: http://www.filedropper.com/file_210

I apologize for the vague-ness of this post as I'm a bit confused as to where I should even start. I've been trying to figure out how to do this for hours and have come up incredibly short.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user3330644
  • 413
  • 1
  • 6
  • 17
  • 3
    Have you seen this? http://stackoverflow.com/questions/2587766/how-is-a-crc32-checksum-calculated – Cristian Quiroz Jun 24 '14 at 15:20
  • @CristianQuiroz Yes I have... it confuses me greatly – user3330644 Jun 24 '14 at 15:23
  • 3
    Calculating this by hand it's hard. My suggestion is either grab the pseudo code from somewhere and write a script that will calculate for you, or use someone else's script. – Cristian Quiroz Jun 24 '14 at 15:26
  • 1
    This is seriously difficult by hand, and if the linked page "confuses you greatly" you're probably in for an extremely hard time. The obvious (and common sense) solution is to use multiple external sources to check the same file, and make sure the output of fsum matches those other sites. If they agree, the chances are very high that they're right; it's highly unlikely that several of them have implemented the same algorithm in exactly the same (flawed) fashion. – Ken White Jun 24 '14 at 17:36
  • Read [Ross William's CRC tutorial](http://zlib.net/crc_v3.txt). However the chance that you can correctly compute by hand a CRC-32 on even just 71 bytes is vanishingly small. The code will be validating your hand calculation, not the other way around. Use the zlib code, which is in extremely wide use, to validate fsum. The correct CRC32 (not CRC32C) of file.txt is `0x5be2b4d5`. – Mark Adler Jun 25 '14 at 05:45

0 Answers0