[英]Hash calculation in torrent clients
I was wondering if someone knows what a "hash" in a BitTorrent client is referring to, it is clearly not the hash
code of the file, but something different. 我想知道是否有人知道BitTorrent客户端中的“哈希”是什么,它显然不是文件的
hash
码,而是一些不同的东西。
I think thats more a magnet link to a file, but how is this connected to the file itself? 我认为这更像是一个文件的磁铁链接,但这是如何连接到文件本身的?
I just want to understand the construct behind the scene. 我只是想了解场景背后的构造。
File <--> Hash <---> hash in torrent client 在torrent客户端中文件< - >哈希<--->哈希
The hash
in a torrent client or the hash
you find in a magnet-URI
is the SHA1-hash of the raw bencoded
info-dictionary
-part of a torrent
-file. 该
hash
在洪流客户端或hash
你在找magnet-URI
是原始的SHA1散列bencoded
info-dictionary
一的双组分torrent
-file。
To understand how that works you need to know two things: 要了解其工作原理,您需要了解两件事:
How a torrent
-file is built. 如何构建
torrent
文件。
How bencode
ing is done. 如何完成
bencode
。
Both of these are explained in the offical bittorrent specification that you can find here: http://bittorrent.org/beps/bep_0003.html 这两个都在官方bittorrent规范中解释,你可以在这里找到: 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 但是我建议你改为阅读你可以在这里找到的非官方规范: https ://wiki.theory.org/BitTorrentSpecification
as it is much easier to understand. 因为它更容易理解。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.