[bittorrent] About getting the info hash value from a .torrent file

Richard Nyberg rnyberg at murmeldjur.se
Tue Oct 25 03:51:26 EDT 2005

At Tue, 25 Oct 2005 15:34:58 +0800,
FYP 2005 wrote:
> I have some silly question here.  I'm going to get the info hash
> from a .torrent file. From the specification.  the info hash is a
> 20-byte SHA1 hash of the *value* of the *info* key from the Metainfo
> file.

Here's a compacted version of your torrent file with brackets


Compute the SHA1 hash of the bytes between the brackets.

> When I look at the content inside the torrent.  I found some
> strange or weird characters after pieces40:. ie.
> :eqn?cc甖灉??恨?L}s?ll?0?剌 What
> are they ?  It seems that they are byte String . isn't it ?  How to
> convert those weird characters into readable characters ?  Do I need
> to convert those weird char into readable format before finding the
> info hash value so that i can get a correct info hash value?

They do not represent readable characters. More info on the contents of
torrent files can be found at <URL:http://www.bittorrent.com/protocol.html>.


More information about the BitTorrent mailing list