I am trying to implement sha-3 in python.The code given below is how I implemented it.But i am getting the below error again and again.
import sys
import hashlib
arg1 = sys.argv[1]
with open(arg1, 'r') as myfile:
data=myfile.read().replace('\n', '')
import sha3
s=hashlib.sha3_228(data.encode('utf-8')).hexdigest()
print(s)
The following error is what i get when I execute it.
Traceback (most recent call last):
File "sha3.py", line 6, in <module>
import sha3
File "/home/hello/Documents/SHA-3/sha3.py", line 7, in <module>
s=hashlib.sha3_228(data.encode('utf-8')).hexdigest()
AttributeError: 'module' object has no attribute 'sha3_228'
The below link can be used for reference. https://pypi.python.org/pypi/pysha3