Task4_8.py 432 B

12345678910111213
  1. def generateHashUsingSHA3_256(fileName):
  2. print("SHA3_256")
  3. data=getData(fileName)
  4. data=bytes(data,"utf-8")
  5. start = timer()
  6. h = SHA3_256.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))