OK我已經搜索了所有相關的問題,以及可用的源代碼,只是卡住了。我使用的是相關問題的代碼: How to calculate the hash value of a torrent using Javainfo_hash爲torrent計算不正確
構建SHA-1散列。
然後我這樣做是爲了對其進行編碼,要被包括在跟蹤請求:
URLCodec C =新org.apache.commons.codec.net.URLCodec(); return new String(c.encode(info_hash));
但跟蹤器回覆沒有同行。通過跟蹤uTorrent,我可以看到我的torrent文件的正確散列是: T%7f%bc%a6%92%bb%8a%8b%2aL%b9%a3%0f%a59%f3%98%e6%0c %EB
但我的代碼輸出: %E4%AF%3C%96%9E%D2%奧吉通%C0%C3%B4%12%93%D4H%3B%9A%2CF
任何想法爲什麼這不起作用?
基本上你需要來urlencode信息散列的二進制* *的形式。這是經常被問到的問題,實際上SO已經有這樣的答案:http://stackoverflow.com/questions/4072234/bittorrent-tracker-request-format-of-info-hash –