Closed josiekre closed 6 years ago
The method you are mentioning does look to be correct Python, it's just written shorthand.
$ python
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.md5("foo").hexdigest()
'acbd18db4cc2f85cedef654fccc4a4d8'
Returns no Python errors.
I opened the issue because .digest('hex')
produces errors.
$ python
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.md5("foo").digest('hex')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: digest() takes no arguments (1 given)
oh! 🤦♂️ you are correct!
The index.py
hasn't really been touched (not working).
At the moment the Python library is very minimal until we port over the majority of the code from the NodeJS library (even a bit more to extract from the Java library)
Just digging around in here and testing things out. Looks like you have a node function here rather than the python function.
In
index.py
See
hashlib
documentation.