Usage of fast and secure hash algorithms to detect if a file was
previously uploaded to the server and use that file's identifier instead
of re-uploading it, for using less bandwidth and speeding up uploads.
Example:
Bob wants to upload file A.mp4 and send it to one of it's contacts.
Client calculates the sha256sum of the file and sends it to the server.
Server looks up the hash and figures out if it's already uploaded to
telegram.
If found: instruct client with the founded file's identifier to be used
in the message body, skipping the upload
If not found: let the client go and upload as usual, then hash it on the server-side and store the hash in database
Other improvements to speed and privacy can be done this way:
Client only sends first 6-12 characters of the hash, if a possible one
was found, it again asks for the complete hash (to make sure), and then
matches it.