A CLI Tool (Command-Line Interface) for generating, comparing and saving SHA256 Hash Code.
SHA-256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function that takes an input and produces a fixed-size 256-bit (32-byte) output, typically represented as a 64-character hexadecimal string.
-
Bitcoin and blockchain technology
-
Password hashing (often with salting)
-
File integrity verification (checksums)
-
Digital signatures and certificates
-
Data fingerprinting
-
and so on.
Well it's so easy to work with this application. As I mentioned, it's a Command-Line Interface and you should work with it with cmd on windows.
Before we get inside of it, it's better for you to add the executable format (.exe) to the Environment path on windows. You can put any name on it. The default name is SHA256.exe
There are lots of tutorials that teach how we can do this. It's better to take a look of them.
Any way, here we learn how this app works:
As you can see, I wrote the basic usage of how can we work with it.
But here I try to explain it with more details.
At first, this app opens files as stream. It means you can generate hash code from large file (more that 50 GB), but it takes time, you know!
This app reads files byte by byte!
Now there we are!
The simplest way that we use all the time is hashing file for downloading, I mean, when we download a file from internet,
they provide the file with a SHA-256 code, something like 5f82577456dd4637fc4f79350cc8a1db4b8505a9d5b22c73a75aef18e34efeb7!
What is it used for?
We use hash codes to be sure we downloaded a file completely.
It means we use it just for downloading? Ofcource not!
We use it Everywhere I mentioned that before.
In this app, we can generate hash code from files.
The simplest option we can use here is -f
-f means generate hash code from specified file.
Example:
As you can see it generated hash code.
You can save the hash code to a .xml file too with option -s
Here are the example:
Notice: if you use -s option with a specified path, app doesn't display the hash code on screen!
It will save the hash code to a file called GeneratedHash.xml, this option doesn't generate the folder it should be generated before
Option -s is optional, you can use it or not, it's your choice.
The next option we can use is d, option -d means search a directory and subfolders and all files (Seaching full directory)
and then generate hash codes from all files.
It's better to use option -s with it because maybe the directory you choose has more that 300 files, and if you don't use -s,
it will print all of them on the screen(it makes the screen ugly, you know!)
The example of using -d with -s:
OK, now we're gonna see the option -c, Comparing...
I know comparing is so cool the thing that all of us want.
This option can take two actions:
- 1 The simplest: Compare two hashes
Example:
- 2 The hardest(somehow): Compare two GeneratedHash.xml
Example:
The comparing hash codes with two GeneratedHash.xml works simple.
At first, it counts the Element File
Example:
As you can see, I highlighted them with yellow, the application count all of the File Element from first and second GeneratedHash.xml,
If they were the same, it will compare Element by Element from first to last.
Example of comparing two GeneratedHash.xml (I edited some values to print the incorrect files for testing):
Here we undestand how many errors we got, and which files are incorrect.
Some tips befor using my app
1 - Please don't edit the GeneratedHash.xml files. It's so important!
2 - If you wanna checksum files, at first copy them from source to your destination, then generate hash codes from source and destination, Then compare them.
Don't copy them and change file name and generate hash codes, the comparing works with file name and hash codes.
3 - And please if you got any error, feel free to tell me, I'm here to listen and help.
I use my app for generating hash codes and checksums of files especially videos
When I copy some videos from source to a destination, I checksum and compare them
I hope you enjoy my application...
That's it.Thanks for reading.
Just for NB!