Encode content if not encoded before hashing
This commit is contained in:
parent
635a48c337
commit
234fca90a3
1 changed files with 2 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue