Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a LINUX command line tool for CRC32C (Castagnoli)

I need to verify data using CRC32C, the Castagnoli variant of CRC32 calculation. I cannot find a self-contained command line utility anywhere that will calculate this to verify the values in question. CRC32? MD5? SHA? Check. CRC32C? You lose.

I need a program. Has to be self contained (no non-standard PERL or Python modules that require installation...standard ones are okay). Probably no Java, as I cannot guarantee a Java installation. Ruby is right out.

Clever "gzip" or "tar" tricks are fine. Needs to run on OS-X, Linux, and maybe Android.

I could indeed write one (the code is in the RFC), but c'mon...that's sort of like

"hmmm, my car uses synthetic oil...time for an oil change, let me go to the local refinery and make a few quarts"

or

"Uncle Bill wants a PB&J sandwich, but has a gluten allergy...let me go get some rice flour and make gluten-free bread".

I found some libraries to calculate CRC32Cs, but no programs. Grumble.

https://developers.google.com/storage/docs/composite-objects?hl=ja

like image 438
Mark Gerolimatos Avatar asked Feb 12 '23 15:02

Mark Gerolimatos


2 Answers

Starting with 4.4, gsutil supports a 'hash' command that can compute hashes like so:

gsutil hash filename

It will output CRC32C and MD5 by default.

like image 184
Travis Hobrla Avatar answered Feb 15 '23 10:02

Travis Hobrla


gsutil will include a new "hash" command in the next release (gsutil 4.4) - which should be out pretty soon.

like image 20
Mike Schwartz Avatar answered Feb 15 '23 11:02

Mike Schwartz