问题描述
我想知道是否有人知道BitTorrent客户端中的哈希是指什么,它显然不是该文件的哈希
代码,但有些不同。 我认为这更多的是一个磁盘链接到一个文件,但它是如何连接到文件本身?
我只是想了解场景背后的结构。
文件< - >哈希< - >在torrent客户端中的哈希值
在一个torrent客户端中的哈希
或者你在a中找到的哈希
magnet-URI
是原始 bencoded
info-dictionary -
torrent部分
- 文件。
为了理解这个方法,你需要知道两件事:
-
torrent如何构建。
-
如何 bencode
ing完成。
然而我建议你而是阅读您可以在这里找到的规范说明:
,因为它更容易理解。
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.
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
解决方案 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.
To understand how that works you need to know two things:
How a torrent
-file is built.
How bencode
ing 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.
这篇关于在洪流客户端的哈希计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!