Feb-11-2018, 12:40 PM
(This post was last modified: Feb-11-2018, 12:40 PM by rajtekken5.)
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:
apple
banana
grape
watermelon
stawberry
my Code is :
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:
apple
banana
grape
watermelon
stawberry
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")
