def dict_hash(dct):
dct_s = json.dumps(dct, sort_keys=True)<EOL>try:<EOL><INDENT>m = md5(dct_s)<EOL><DEDENT>except TypeError:<EOL><INDENT>m = md5(dct_s.encode())<EOL><DEDENT>return m.hexdigest()<EOL>
Return a hash of the contents of a dictionary