Fixed the issue with utf8 filenames hashing

This commit is contained in:
Uriziel 2013-11-10 13:09:28 +01:00
parent 14bb074aa9
commit 9a7d2c19fc

View File

@ -136,7 +136,7 @@ def stripfilename(filename):
return re.sub(constants.FILENAME_STRIP_REGEX,"",filename)
def hashFilename(filename):
return hashlib.sha256(stripfilename(filename)).hexdigest()[:12]
return hashlib.sha256(stripfilename(filename).encode('utf-8')).hexdigest()[:12]
def hashFilesize(size):
return hashlib.sha256(str(size)).hexdigest()[:12]