Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate SFV-style CRC32 in Linux commandline?

Is there an equivalent to md5sum/sha1sum in Linux for calculating SFV-style CRC32s? I checked out cksum, but it seems to be calculating a different sum (perhaps a different polynomial? or I'm interpreting cksum's output wrong). Preferably not using cfv/cksfv (both of which seem to be deprecated, and I would prefer not to download/compile a not-so-new tool every time I want to calculate this.

Also, would prefer not to do manual coding in C/C++/Java myself (i.e. would prefer not to implement the CRC32 personally), for the same reason as above.

If anyone knows exactly which CRC32 polynomial SFV uses (IEEE, Castagnoli, non-CRC Adler, etc.) that would be a great start as well.

Anyhow, many thanks in advance!

EDIT: seems not to be the adler, based on a Windows hashing tool that implements both Adler32 and something it only labels "CRC32".

like image 408
Henry Tung Avatar asked Jun 08 '11 18:06

Henry Tung


1 Answers

CheckSFV is a good open source tool and has a '-c' option to generate to stdout. But more importantly you can simply take the CRC32 calculation code if you are looking to use in C application (providing due licensing and credits are followed of course).

http://zakalwe.fi/~shd/foss/cksfv/

Hope this helps.

like image 88
chkdsk Avatar answered Oct 30 '22 06:10

chkdsk