I made a SHA256 checker.
How to use SHA256-Checker? Step 1: Download the file you want to check and sha256sum.txt from the Internet then put them inside dist folder.
Step 2: Open hash.exe. Step 3: Type the file name. (Example:pycharm-community-2020.2.exe). Then the program will generate hash from the check file and compare the hash inside sha256sum.txt. If two of them are matched.The program will display "Hash correct". Otherwise the program will display "Hash incorrect".
Notice: If the website only provided you a SHA256SUM value then you need to create a text file called sha256sum.txt After that paste the hash value inside the text file. The SHA256SUM hash format should look like this. hashvaule *filename.extension or hashvaule filename.extension
For example: 65afa1b90f3ecc45946793c4c43a47a46dff2e1da0737ce602f5ee12bd946f1e *pycharm-community-2020.2.exe
93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7 debian-10.5.0-amd64-netinst.iso 14ca00bafcaf124ef2cab9da2f51d75044232ba9630a067d8664fabcb5e26ec2 debian-10.5.0-amd64-xfce-CD-1.iso 7fe10f143b7f697ecabe3d4b2f94d523ad74ffb1743e5c86586a3f57ea904f35 debian-edu-10.5.0-amd64-netinst.iso 461af35784ef816401297902c531a03614429003bdea0ea26fb19f57e0aaa4c6 debian-mac-10.5.0-amd64-netinst.iso
If you think the download source is untrusted.Never download any files or hash files from them.
If you have any question feel free to ask me. Thank you!
![[Image: Screenshot1.jpg]](https://raw.githubusercontent.com/gingshow/SHA256-Checker/master/dist/Screenshot1.jpg)
![[Image: Screenshot2.jpg]](https://raw.githubusercontent.com/gingshow/SHA256-Checker/master/dist/Screenshot2.jpg)
How to use SHA256-Checker? Step 1: Download the file you want to check and sha256sum.txt from the Internet then put them inside dist folder.
Step 2: Open hash.exe. Step 3: Type the file name. (Example:pycharm-community-2020.2.exe). Then the program will generate hash from the check file and compare the hash inside sha256sum.txt. If two of them are matched.The program will display "Hash correct". Otherwise the program will display "Hash incorrect".
Notice: If the website only provided you a SHA256SUM value then you need to create a text file called sha256sum.txt After that paste the hash value inside the text file. The SHA256SUM hash format should look like this. hashvaule *filename.extension or hashvaule filename.extension
For example: 65afa1b90f3ecc45946793c4c43a47a46dff2e1da0737ce602f5ee12bd946f1e *pycharm-community-2020.2.exe
93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7 debian-10.5.0-amd64-netinst.iso 14ca00bafcaf124ef2cab9da2f51d75044232ba9630a067d8664fabcb5e26ec2 debian-10.5.0-amd64-xfce-CD-1.iso 7fe10f143b7f697ecabe3d4b2f94d523ad74ffb1743e5c86586a3f57ea904f35 debian-edu-10.5.0-amd64-netinst.iso 461af35784ef816401297902c531a03614429003bdea0ea26fb19f57e0aaa4c6 debian-mac-10.5.0-amd64-netinst.iso
If you think the download source is untrusted.Never download any files or hash files from them.
If you have any question feel free to ask me. Thank you!
![[Image: Screenshot1.jpg]](https://raw.githubusercontent.com/gingshow/SHA256-Checker/master/dist/Screenshot1.jpg)
![[Image: Screenshot2.jpg]](https://raw.githubusercontent.com/gingshow/SHA256-Checker/master/dist/Screenshot2.jpg)
import os import hashlib hash1="" hash2="" if os.path.isfile('./sha256sum.txt'): print("sha256sum.txt exists") file1 = open("sha256sum.txt", "r") else: print("sha256sum.txt does not exists,please make sure your file name is correct") input("Press enter to exit") exit(0) #Display list of files inside directory print("Display list of files:") for x in os.listdir('.'): print(x) filename = input("Please enter the file name: ") print("Extracting hash from %s ..." % filename) sha256_hash = hashlib.sha256() with open(filename,"rb") as f: # Read and update hash string value in blocks of 4K for byte_block in iter(lambda: f.read(4096), b""): sha256_hash.update(byte_block) hash1=sha256_hash.hexdigest() l=file1.readlines() for word in l: if filename in word: # find match line by file name print(word) #debug clearline1 = word.replace(filename, '') # clear file name clearline2 = clearline1.replace('*', '') # clear * clearline3 = clearline2.strip() # clear whitespace and new lines hash2=clearline3 if hash1 == hash2: print("Hash1 is %s"%hash1) print("Hash2 is %s" % hash2) print("Hash correct") input("Press enter to exit") else: print("Hash1 is %s" % hash1) print("Hash2 is %s" % hash2) print("Hash incorrect") input("Press enter to exit")