Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bittorrent tracker request, format of info_hash

Tags:

bittorrent

When I want to send an initial request to a tracker all references I've seen says it needs to be url-encoded. If I transform the SHA-1 hash I have of the info key into a hex string, why would I need to url-encode the hash? It only contains allowed characters.

like image 855
JoGr Avatar asked Nov 01 '10 19:11

JoGr


1 Answers

The info_hash parameter is not a hex string. It's a pure binary string, so yes, you will have to URL-encode many of the bytes in it. (This tends to make it longer in the end than just using a hex-encoded string, but that's the BitTorrent protocol for you, too late to do anything about it now!)

like image 147
bobince Avatar answered Sep 21 '22 00:09

bobince