What is the best way to calculate a checksum for a file that is on my machine?

The CertUtil is a pre-installed Windows utility, that can be used to generate hash checksums:

CertUtil -hashfile pathToFileToCheck [HashAlgorithm]

HashAlgorithm choices: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512

So for example, the following generates an MD5 checksum for the file C:TEMPMyDataFile.img:

CertUtil -hashfile C:TEMPMyDataFile.img MD5

or

HashCheck which integrates itself as a property page for files and includes a context menu to compare against hash check files (SFV).

It is free, and the source is available.

原文地址:https://www.cnblogs.com/andy-0212/p/9985635.html