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

FYP 2005 hkucsfyp2005 at gmail.com
Tue Oct 25 03:34:58 EDT 2005


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.
 Below is my content of the torrent.
 d8:announce35:
http://bt.gamesir.com:6969/announce13:announce-listll35:http://bt.gamesir.com:6969/announceel35:http://bt.gamesir.com:8080/announceel35:http://bt.gamesir.com:8000/announceel39:http://tlfbt.eastgame.net:6969/announceel39:http://tracker.btzero.net:8080/announceel37:http://tlfbt.eastgame.net:81/announceel39:http://tracker.btzero.net:8000/announceee10:createdby13:BitComet/0.6013:creation
datei1130084762e8:encoding4:Big54:infod6:lengthi46029e4:name24:PwC(CampusInterview).pdf10:
name.utf-824:PwC(CampusInterview).pdf12:piece
lengthi32768e6:pieces40:eqn?cc甖灉??恨?L}s?ll?0?剌ee
 Then I try to use sha1 algorithm to get the info hash from the torrent.
However, it seems that the result that i got from the algorithm is different
from the one that I got from BitComet or TorrentSpy. I am quite sure that my
algorithm is correct as I just used a sha 1
function from php.
  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?
  thx !!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/bittorrent/attachments/20051025/603df5e4/attachment.html 


More information about the BitTorrent mailing list