Alter Lagos Asked: 2013-06-04 10:20:51 +0800 CST2013-06-04 10:20:51 +0800 CST 2013-06-04 10:20:51 +0800 CST How to check crc of a file? 772 I was looking this question and appears everything but crc. Is there a good Ubuntu way around there to do this? command-line 6 Answers Voted Best Answer Alter Lagos 2013-06-04T10:24:25+08:002013-06-04T10:24:25+08:00 $ sudo apt-get install libarchive-zip-perl $ crc32 my_file Leo 2013-06-04T10:26:35+08:002013-06-04T10:26:35+08:00 One way to calculate it is this: cksum "file" Another one is crc32 "file" To use this last command you need to install libarchive-zip-perl package mdpc 2013-06-04T10:26:45+08:002013-06-04T10:26:45+08:00 I'd use the internal md5sum one of the provided sha programs: sha1sum (1) - compute and check SHA1 message digest sha224sum (1) - compute and check SHA224 message digest sha256sum (1) - compute and check SHA256 message digest sha384sum (1) - compute and check SHA384 message digest sha512sum (1) - compute and check SHA512 message digest cksum is pretty much outmoded these days because of its problems. Miki 2016-12-08T22:16:53+08:002016-12-08T22:16:53+08:00 cksfv app from cksfv package generates CRC32 checksum as well. Woosung 2021-09-15T23:06:12+08:002021-09-15T23:06:12+08:00 You can try to use rhash. http://rhash.sourceforge.net/ https://github.com/rhash/RHash http://manpages.ubuntu.com/manpages/bionic/man1/rhash.1.html Test: $ sudo apt-get install rhash $ echo -n 123456789 | rhash --simple - cbf43926 (stdin) schezel2000 2021-05-08T10:23:36+08:002021-05-08T10:23:36+08:00 you can accomplish this with a very simple perl script. use String::CRC32; my $s = <STDIN>; my $crc = crc32($s); printf "%08x\n", $crc;
One way to calculate it is this:
Another one is
To use this last command you need to install
libarchive-zip-perl
packageI'd use the internal
md5sum
one of the provided sha programs:cksum
is pretty much outmoded these days because of its problems.cksfv
app fromcksfv
package generates CRC32 checksum as well.You can try to use
rhash
.Test:
you can accomplish this with a very simple perl script. use String::CRC32;