Hash calculation in torrent clients

微笑、不失礼 提交于 2019-12-01 00:13:44

The hash in a torrent client or the hashyou find in a magnet-URI is the SHA1-hash of the raw bencoded info-dictionary-part of a torrent-file.

To understand how that works you need to know two things:

  • How a torrent-file is built.

  • How bencodeing is done.

Both of these are explained in the offical bittorrent specification that you can find here: http://bittorrent.org/beps/bep_0003.html

However I recommed that you instead read the inoffical specification that you can find here: https://wiki.theory.org/BitTorrentSpecification
as it is much easier to understand.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!