Handle when source is not plain ascii

This commit is contained in:
Michal Čihař 2012-03-01 15:54:44 +01:00
parent 5d083a981c
commit 9f31f6ba1e

View File

@ -21,7 +21,7 @@ def msg_checksum(source, context):
We use MD5 as it is faster than SHA1.
'''
m = hashlib.md5()
m.update(source)
m.update(context)
m.update(source.encode('utf-8'))
m.update(context.encode('utf-8'))
return m.hexdigest()