blog-files/2108-compare
vedri 1d98ca27ed Update author name 2021-08-08 17:50:38 +02:00
..
Makefile Update author name 2021-08-08 17:50:38 +02:00
README.md Add blog post link 2021-08-08 17:49:10 +02:00
compare.c Update author name 2021-08-08 17:50:38 +02:00

README.md

Compare SHA Sums

Also posted August 8th, 2021 on Dreamwidth.

Idea

I wanted to practice working with files in C programs and at the same time check if the SHA sums for a Manjaro ISO file were the same.

Prerequisites

Usage

Place the compare.c and Makefile in the same directory. Build compare.

make compare

Either download or create a text file. The first line of the text file should contain only the SHA sum provided by the developer.

Example of sha-test.txt:

6ff0ebecb9813542e1fa81bbe897bb59039bb00d 

Append to the file a SHA sum you generated yourself.

sha1sum ISO-name >> sha-test.txt

Resulting sha-test.txt:

6ff0ebecb9813542e1fa81bbe897bb59039bb00d 
6ff0ebecb9813542e1fa81bbe897bb59039bb00d ISO-name 

Run compare and enter the name of the file with SHA sums when prompted.

$ ./compare
Filename: sha-test.txt
# The program prints whether SHA sums match or not.