This is a brief guide on how to check the checksum of a file you download to install on your computer. I will be showing you how to do this on your Mac.
A checksum is a value that represents the number of bits in a transmission message.
We want to check the checksum to detect high-level errors within data transmissions. Prior to transmission, every piece of data or file can be assigned a checksum value after running a cryptographic hash function.
On your Mac, go open up "Terminal" and go to the folder that has the file you want to check the checksum for. In my example, my file is in my Downloads folder.
Open your "Terminal" or command line software (e.g. iTerm, etc.).
cd Downloads
ls
shasum -a 256 openjdk-16.0.2_osx-x64_bin.tar.gz
Notice that it has the checksum:
e65f2437585f16a01fa8e10139d0d855e8a74396a1dfb0163294ed17edd704b8
This is your sha256 checksum output.
Alternatively, we can use the OpenSSL version to check.
openssl sha256 openjdk-16.0.2_osx-x64_bin.tar.gz
Typically, the next step now is to compare this detail to the sha256 checksum with where you downloaded the file from.
Here is an example of how we can check the checksum of a download.
We will use the example of downloading JDK 16 to your Mac, as you can also follow this as well.
e65f2437585f16a01fa8e10139d0d855e8a74396a1dfb0163294ed17edd704b8
If we compare to the sha256 checksum from our Terminal earlier:
That's it, you're all set now.