Welcome to the Treehouse Community
Looking to learn something new?
Declan Smith453 Points
I entered hashlib.shake_128(b'Treehouse').hexdigest(20) and get back an error stating that there is no Attribute called shake_128
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'shake_128'
Is my Terminal software missing anything or did I enter the wrong thing into Python?
Andrew Merrick20,151 Points
I've also gotten the same error but the machine I used had only Python 2.7 and, I believe, that shake_128 only works with Python 3. Not 100% accurate on that since the only documentation I can find is for Python 3.6.1.
Really cool lesson though!
Andrea Gomez8,609 Points
You have to import hashlib in order to use shake_128 so you should do the following:
>>> import hashlib >>> hashlib.shake_128(b'Treehouse').hexdigest(20) >>> '16254ff15a16c961a2e87bf54d2ddac477f1d0a1'
You can read more about shake_128 and hashlib in the official documentation