Skip to content

Checksum

Description

A checksum is a small-sized datum from a block of digital data for the purpose of detecting errors which may have been introduced during its transmission or storage.

Each checksum is generated by a checksum algorithm. Basically, it takes a file as input and outputs the checksum value of that file. There are various algorithms for generating checksums. Here is the name of some of them and the tool employed to generate them:

Algorithm Tool
MD5 md5sum
SHA-1 sha1sum
SHA-256 sha256

How to use checksum to verify file integrity

Go to the directory where the file is stored. Let's suppose we are using MD5 to checksum the file.

md5sum fileName

As a result, it prints out the MD5 (128-bit) checksum of the file. Usually, when downloading a file you are given a checksum to compare it with the one you can generate from the file. If there is a difference, no matter how minimum that is, then we can assume the downloaded file has been alterated.

Last update: 2023-04-11
Created: January 1, 2023 21:59:36