Search code examples
windowschecksum

Windows equivalent of linux cksum command


I'm looking for a way to compute CRC checksums cross platform.

cksum works on Linux, AIX, HP-UX Itanium, Solaris, but is there an equivalent command available in Windows too?

%cksum run.sh
1491301976 652 run.sh

Note: I'm not interested in third party tools.


Solution

  • 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://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc732443(v=ws.11)