Fix Md5ChecksumInvalidError for small files

This commit is contained in:
NotStatilko 2021-04-10 20:38:07 +03:00
parent 4b16183d2b
commit d9c3e802ab

View File

@ -606,16 +606,16 @@ class UploadMethods:
pos += len(part)
# Encryption part if needed
if key and iv:
part = AES.encrypt_ige(part, key, iv)
if not is_big:
# Bit odd that MD5 is only needed for small files and not
# big ones with more chance for corruption, but that's
# what Telegram wants.
hash_md5.update(part)
# Encryption part if needed
if key and iv:
part = AES.encrypt_ige(part, key, iv)
# The SavePartRequest is different depending on whether
# the file is too large or not (over or less than 10MB)
if is_big: