info_hash parameter

Apr 19, 2012 at 10:15 PM
Edited Apr 19, 2012 at 10:15 PM

how can the info_hash parameter be calculated, using this Bencoding lib??

 

BDict info_dict = torrent_dict["info"];

String info_content = info_dict.Encode();

byte[] info_bytes = UTF8encoding.GetBytes(info_content);

and do hash on that??

 

I tested this with multiple torrent files.. and still wrong hash..

Am I doing it wrong.. should the dict & all inner dict be sorted.. and if YES: can I have a guideline on how to do that? (oh yeah..tested also with ASCII encoding)

Coordinator
Jul 17, 2012 at 4:08 PM

Hi,

Sorry for the late response, but I've done a rewrite as I was trying to solve this problem myself.
The result is now available as version 0.4, and I've made a helper function to help you hash torrents.

Regards,
Mike