Task4_7.py 432 B

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