Jump to content

How to gen. checksums 'manually' to have them match with .torrent?


ros

Recommended Posts

I would like to check 'manually' (e.g with separate program) if the files that I've downloaded have the checksums that they're supposed to have (matching with .torrent). Is it possible somehow? I've tried few different checksums over a completed file but none of them matched.

Link to comment
Share on other sites

How come I can't make it match?? I've tried SHA1 before (using other tool) and now with Hashcalc too and they both give the same checksum but unfortunately not matching with uTorrents General Tab>Hash. uTorrent displays 5x 8 bytes (separated by spaces) which equal 40 just like SHA1. Moreover all torrents I've tried passed the hash verification (in fact they are archives that also pass it's internal verification) so there is no doubt they aren't corrupted.

Link to comment
Share on other sites

If you want to compare with the hashes in a .torrent file, then the answer is: you have to use a BitTorrent client. If you just want a generic hash, try something like HashTab, but don't expect to be able to use that hash to compare with anything in the .torrent file.

Edit: The hash in the General tab is the infodict's hash, not the hash of the files.

Link to comment
Share on other sites

You don't need a bittorrent client to verify or even create torrent files.

The "cfv" utility at SourceForge can do that for you. "cfv" stands for "Command-line File Verify" and it can also verify ".torrent", ".par2", ".md5", and many other types as well as create some of those same file types, including ".torrent" files.

It is a very handy utility that I use to check all my torrent files. Source code and binary formats are available at:

http://cfv.sourceforge.net/ or http://sourceforge.net/projects/cfv

Link to comment
Share on other sites

@ros

No special command. The torrent file contains all the necessary information in case of multiple files and the individual pieces that make up those files. Torrents do not need to be complete to use it. It will inform you of missing files or of damaged files.

"cfv -f specific.torrent" will check all the files listed within the torrent "specific".

"cfv -t torrent" will check all the files listed in all ".torrent files" in the current directory.

Just read the documentation or use "cfv -?" for a quick reference of all the options.

EDIT: The info_hash given on websites for a specific torrent files, serves only to check if the torrent file itself is not corrupt. It is not used to verify the files listed within the torrent. The torrent file contains within it, the hashes for the individual pieces that make up the file (or files) that are listed in the torrent. Don't confuse those two types of hashes. "CFV" checks both to verify that the torrent file itself is OK and then checks the individual file pieces listed by the torrent.

I good way to see the breakdown of a torrent file is to view the XML version of a torrent that Azureus can export. It would be nice if uTorrent could also export and import these XML torrent files too.

Link to comment
Share on other sites

@Saribro

You are being disrespectful to "ros" with your "Duh". If he understood the torrent principals he would not be asking others for help on it, now would he? Remember that you yourself don't fully understand the principals either, from the look of things. We are all learning and doing our part to help others learn too.

@ros

"Saribro" is partially correct, but is wrong in his assumption. Torrent files do contain all the info for each file. If it did not, it would be useless. However, it does not contain the individual hashes for each complete file and that is probably what he meant to say. Instead, the torrents have hashes of the individual pieces making up the files and that is what needs to be taken into account when considering the edge pieces (i.e. pieces at the end of files, as they also contain data from the beginning of the subsequent files). So the last piece of file "A" also contains data of the beginning of file "B". In the case of an edge piece being corrupt then 2 files are affected by it and both show bad CRC.

However, I repeat, that the torrent does not have to be 100% complete in order to check the files. Just as long as you understand how the edge pieces will affect the outcome.

You will notice, that uTorrent, uses partial files to contain the edge pieces when you select only some of the files for download instead of everything. If you are astute, you can manipulate these partial files so to augment the test of the torrent so as to guarantee that the edge pieces are correctly tested as valid and not corrupt. However, for a beginner it might be easier to just use uTorrent itself (only in these special "edge" cases). As you progress with your knowledge of torrent files, you will be able to handle the partial files and testing with "cfv" for these special cases too.

EDIT: Some torrent files do contain an MD5 hash for each of the files listed in a torrent, but this is not very widespread due to the fact that many BitTorrent clients do not use this information.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...