I am new to coding and have ran into a problem trying to encode a string.
>>> import hashlib >>> a = hashlib.md5() >>> a.update(\'
A solution that works in both py2/py3:
from six import ensure_binary from hashlib import md5 md5(ensure_binary('hi')).digest()