Encode content if not encoded before hashing

This commit is contained in:
Aditya Hase 2017-09-26 19:30:35 +05:30
parent 635a48c337
commit 234fca90a3

View file

@ -301,6 +301,8 @@ def get_file_path(file_name):
return file_path
def get_content_hash(content):
if isinstance(content, text_type):
content = content.encode()
return hashlib.md5(content).hexdigest()
def get_file_name(fname, optional_suffix):