[bittorrent] Getting Hash of Pieces

ntorrent.20.draza at spamgourmet.com ntorrent.20.draza at spamgourmet.com
Tue Nov 6 08:35:58 EST 2007

> I am  trying to get a list of the hashes of each piece in a torrent
> I attempted it but my code is not working.
> Is there any example code I could look at.

It would be easier to help you if you can tell us *what* exactly did you try
that didn't work? Hashes of pieces are trivial to extract from the .torrent
file once you have written your own codec for the bencoding format (special
way used to store small subset of data [ints, strings, lists,
dictionaries]). The spec for the bencoding format is here:

There's plenty of code to look at. Not only are there several open source
BitTorrent implementations in multiple "classic" programming languages
(Python-official BitTorrent, C#-MonoTorrent, C++-libtorrent, Java-Azureus)
but since trackers need to read this format there are also implementations
in PHP and other dynamic web server pages languages.

What exactly is the problem?


More information about the BitTorrent mailing list