#import Modules
import hashlib
import pathlib
import sys
import os

#make a blank list
hashs = []
filenames =[]

#take filename input
for _ in range(2):
	filenames.append(input("File name: "))
#main thing does the hashing
def hash(files):
	hashs = []
	print("starting hash this could take a while depending on file sizes")
	for filename in files:
		if os.path.exists(filename): #checks if file exists
			hasher = hashlib.sha256()
			with open(filename, 'rb') as f: #open file
				content = f.read() # passes file to hashing lib
				hasher.update(content)
			hashs.append(hasher.hexdigest()) #adds hash to the list
		else:
			sys.exit("File not found") #tells if file is not found
	return hashs
hashs =hash(filenames) #calls the main function and writes to list "hashs"
#checks if hash is same
if hashs[0] == hashs[1]:
	print("Hash is the same. The hash is ",hashs[1])
else:
	print("The hashs are not the same")
	print("File one hash ",hashs[0])
	print("File two hash ",hashs[1])
