I'm having an issue to understand how can I "translate" the info_hash value to a real hash. Here's an example of what I'm getting from uTorrent when it's announcing to my tracker:
{
passkey: "77ec6a27adcc441648d66d0b873550e4",
info_hash: "YNvÿ@p",
peer_id: "-UT3430-89 ",
port: "54790",
uploaded: "0",
downloaded: "491520",
left: "24928863",
corrupt: "0",
key: "A2DD5E96",
numwant: "200",
compact: "1",
no_peer_id: "1"
}
What I'm trying to understand is how do I take this strange value: "YNvÿ@p" and get the info hash as sha1 (like: 594E98760099B1CFC3BFAA4070C0CC02F6C1AA90)? I'm using PHP on my server.
Now I've read already the following statements:
info_hash
The 20 byte sha1 hash of the bencoded form of the info value from the metainfo file. Note that this is a substring of the metainfo file. The info-hash must be the hash of the encoded form as found in the .torrent file, regardless of it being invalid. This value will almost certainly have to be escaped.
But it didn't help me much to understand what's going on.