qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
25.98k stars 3.83k forks source link

Add column in content tab for torrent showing torrent file hashes #20980

Open memoryhash opened 2 weeks ago

memoryhash commented 2 weeks ago

Suggestion

I would like to see end result file hashes of each file I am downloading. I guess there would be 2 columns, one showing hash type and the other showing the hash, since this would need to account for SHA-1 and SHA-256 between Bittorrent v1 and v2.

Use case

Know what on earth I'm downloading ahead of time.

Extra info/examples/attachments

image

something like this highly detailed mspaint mockup

glassez commented 2 weeks ago

I would like to see end result file hashes of each file I am downloading. I guess there would be 2 columns, one showing hash type and the other showing the hash, since this would need to account for SHA-1 and SHA-256 between Bittorrent v1 and v2.

BitTorrent has nothing to do with file hashes. You can calculate the hash only after downloading the entire file. Am I wrong?

HanabishiRecca commented 2 weeks ago

BitTorrent has nothing to do with file hashes. You can calculate the hash only after downloading the entire file. Am I wrong?

BitTorrent v2 does store hashes of individual files. For v1, yeah, it's impossible to know the checksum of a file before you download it.

glassez commented 2 weeks ago

BitTorrent v2 does store hashes of individual files.

If you mean "pieces root" hashes then yes.

HanabishiRecca commented 2 weeks ago

If you mean "pieces root" hashes then yes.

Yes. Although, it's not clear for me from the spec, if it corresponds to actual file content, or just stores "hash of hashes". If it's the latter, the OP's idea is impossible completely.

glassez commented 2 weeks ago

Although, it's not clear for me from the spec, if it corresponds to actual file content, or just stores "hash of hashes".

In short, yes - a "hash of hashes".

If it's the latter, the OP's idea is impossible completely.

We can display such "pieces root" hashes. But what is the benefit of seeing them?

HanabishiRecca commented 2 weeks ago

In short, yes - a "hash of hashes". We can display such "pieces root" hashes. But what is the benefit of seeing them?

In that case, there is no practical benefit, I think. As you don't have any reference to compare it with. Also the resulting hash is different for torrents with different piece sizes, despite the actual content being identical. Which makes the whole thing pointless.

But all that has nothing to do with OP's idea of showing actual file checksums anyway. I.e. sorry @memoryhash, but your idea is impossible to implement with current BitTorrent v1 and v2 protocols.

glassez commented 2 weeks ago

Also the resulting hash is different for torrents with different piece sizes, despite the actual content being identical

These hashes are independent of the piece size.