file_integrity: hash_part: mix length into state

This commit is contained in:
Marian Beermann 2017-05-25 15:31:30 +02:00
parent d463dd89aa
commit 83bca02a4e
1 changed files with 1 additions and 0 deletions

View File

@ -152,6 +152,7 @@ class IntegrityCheckedFile(FileLikeWrapper):
def hash_part(self, partname, is_final=False):
if not self.writing and not self.digests:
return
self.hasher.update(('%10d' % len(partname)).encode())
self.hasher.update(partname.encode())
self.hasher.hash_length(seek_to_end=is_final)
digest = self.hasher.hexdigest()