I am creating a project for generating sha256 hash from text file
I want to read each line from my text file and generate sha256 for it.
Here is the code i written but it is not correct. please see and suggest me.
my text file contains:
my Code is :
import hashlib f = open("D:/12/1.txt",'r') x = f.readline() while(x !=""): hash_object = hashlib.sha256(b'x') hex_dig = hash_object.hexdigest() print(x.strip(),"",hex_dig) x= f.readline() input("Successful..Press enter to exit")