
In that case, the simple comparison of the hashes would not suffice to detect a duplicate content before the process starts, but can be done at a later stage, during the download process. However, it can be complicated further for the case of torrents with different piece sizes in comparison to each other, which would require more intricate development. This is the simple case, and can be implement quite easily. This is effectively the same as using the sources of both to complete both files more quickly. If they do, then as a piece comes in for the file "A" in torrent "A", then it can be automatically also be used for file "B" in torrent "B". When two files (in different single file torrents) have the same overall size and the same piece size, then it is a quick and easy matter of comparing the sequences of hashes to know if the content of the two files is the same, and thus know beforehand if the files match in content. I will describe the process for single file torrents, but can be extended for multiple file torrentsĮach file, has in the torrent a sequence of SHA-1 hashes for each of its consecutive pieces, which is used to verify the file as the pieces get downloaded. I will, however take the time to explain how it can be achieved.
#Torrents easy duplicate finder code#
I could write the code for it myself, but just don't have the time for it.

I do know what I am talking about and I've been in development for over 20 years.

I understand that you do not know me from a "bar of soap" or what my knowledge or experience is, in these matters, but please allow for some respect. Please have some decency and allow for the ideas to be exchanged. Please don't close a topic just because you think it cannot be done.
