K
K
Kirill Batalin2016-05-06 19:46:01
bittorrent
Kirill Batalin, 2016-05-06 19:46:01

How to calculate the Info Hash of a torrent file?

In the BitTorrent protocol, you need to know the Info Hash, but how do you calculate it?
Torrent file stores information in bencode format. Do I need to decrypt it and take only certain data from the Info dictionary? Or do you just need to take a piece of raw text from a file and hash it? If the second option, then from where and to where exactly?
Example torrent file:

d8:announce26:...(трекер).....4:infod6:len.....(хеш-суммы сегментов)....e9:publisher13:tracker.org13:publisher-url50:http://tracker.org/post/123e

What exactly needs to be hashed?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question