Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm on a Windows machine and I want to run a checksum on the MySQL distribution I just got. It looks like there are products to download, an unsupported Microsoft tool, and probably other options. I'm wondering if there is a consensus for the best tool to use. This may be a really easy question, I've just never run a checksum routine before.

like image 954
Bialecki Avatar asked Jan 26 '09 02:01

Bialecki


People also ask

What is the checksum of a file?

A checksum is a string of numbers and letters that's used to “check” whether data or a file has been altered during storage or transmission. Checksums often accompany software downloaded from the web so that users can ensure the file or files were not modified in transit.


1 Answers

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:\TEMP\MyDataFile.img:

CertUtil -hashfile C:\TEMP\MyDataFile.img MD5 

To get output similar to *Nix systems you can add some PS magic:

$(CertUtil -hashfile C:\TEMP\MyDataFile.img MD5)[1] -replace " ","" 
like image 57
Laisvis Lingvevicius Avatar answered Oct 20 '22 16:10

Laisvis Lingvevicius