Task4_6.py 437 B

123456789101112131415
  1. def generateHashUsingSHA256(fileName):
  2. print("SHA_256")
  3. data=getData(fileName)
  4. data=bytes(data,"utf-8")
  5. start = timer()
  6. h = SHA256.new()
  7. h.update(data)
  8. #Because this looks better when viewed instead of h.digest()
  9. digest=h.hexdigest()
  10. end = timer()
  11. #print(digest)
  12. print("Time Taken to generate Hash is ",(end-start))
  13. print("Time Taken to Hash per byte is ",(end-start)/len(data))