prefer hashlib.sha3_256 when available (python 3.6+)
import os
import string
-import sha3 as _sha3
-
+import hashlib
+if hasattr(hashlib, 'sha3_256'):
+ def sha3_256(x):
+ return hashlib.sha3_256(x).digest()
+else:
+ import sha3 as _sha3
def sha3_256(x):
return _sha3.sha3_256(x).digest()
