Fairly happy with your choice to use `getattr` here, as it restricts them to only having the "pure" hashlib algorithms available.

Depending on the version of openssl that's installed, `hashlib.new` can pull other algorithms out:

```python
In [27]: hashlib.new('ripemd160')
Out[27]: <ripemd160 HASH object @ 0x1025402b0>
In [28]: getattr(hashlib, 'ripemd160')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-28-c02bfa21eec7> in <module>()
----> 1 getattr(hashlib, 'ripemd160')

AttributeError: 'module' object has no attribute 'ripemd160'
```