[bittorrent] Fwd: Tracker response

Josef Drexler josef at ttdpatch.net
Thu Jun 11 17:26:10 EDT 2009

On Jun 11, 2009, at 9:10 PM, André Martins wrote:
> In thepiratebay.org, I searched for a torrent with many  seeders and
> leechers for testing my client. And  I'm using this torrent:
> https://thepiratebay.org/torrent/4944727/ 
> Delicious_Sandwich_Recepies_-_379_Of_The_World_Greatest_Deliciou
> One thing I realised now it's maybe I'm not sending the correct hash.
> This torrent has only one file but the pieces entry's length has 300.
> So when I try(in python)
> info_hash = urllib.quote( info['pieces'][:20])
> maybe I'm getting a wrong hash.

Yeah... The torrent hash is the SHA1 of the entire bencoded info  
dictionary. Not just the hash of the first piece.

It'd have be something like (pseudo-code)

info_hash = sha1(bencode(info))

Josef Drexler
josef at ttdpatch.net

More information about the BitTorrent mailing list