Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows equivalent of linux cksum command

I am looking for a way to compute crc checksum cross platform.

cksum works on Linux, AIX, HP-UX Itanium, Solaris, is there a equivalent command of linux cksum in windows too?

%cksum run.sh 1491301976 652 run.sh 

Note: no third party tool

like image 482
AabinGunz Avatar asked Sep 05 '12 07:09

AabinGunz


People also ask

What does cksum mean in Linux?

cksum command in Linux is used to display a CRC(Cyclic Redundancy Check) value , the byte size of the file and the name of the file to standard output. CRC is unique for each file and only changes if the file is edited. It is used to check whether the file had accidentally corrupted while transfer.

What is the cksum command used for?

The cksum command reads the files specified by the File parameter and calculates a 32-bit checksum Cyclic Redundancy Check (CRC) and the byte count for each file. If no files are specified, the cksum command reads standard input. The checksum, number of bytes, and file name are written to standard output.


2 Answers

In Windows (command prompt) you can use CertUtil, here is the syntax:

CertUtil [Options] -hashfile InFile [HashAlgorithm] 

for syntax explanation type in cmd:

CertUtil -hashfile -? 

example:

CertUtil -hashfile C:\myFile.txt MD5 

default is SHA1 it supports: MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512. Unfortunately no CRC32 as Unix shell does.

Here is a link if you want to find out more https://technet.microsoft.com/en-us/library/cc732443.aspx#BKMK_menu

like image 83
Cassian Avatar answered Oct 11 '22 01:10

Cassian


It looks as if there is an unsupported tool for checksums from MS. It's light on features but appears to do what you're asking for. It was published in August of 2012. It's called "Microsoft File Checksum Integrity Verifier".

http://www.microsoft.com/en-us/download/details.aspx?id=11533

like image 45
RyanB Avatar answered Oct 11 '22 02:10

RyanB