什么是torrent文件中的info_Hash [英] What exactly is the info_Hash in a torrent file

查看:2909
本文介绍了什么是torrent文件中的info_Hash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



但有一个问题我不明白。



我有一个文件的hash和一个torrent的infohash,是文件的infohash = hash吗?



如果是,如果洪流descripes 6文件下载?



如果没有什么代表。

解决方案

所以我终于明白了。

infohash 是对包含以下内容的torrent文件的一部分进行SHA1散列处理:


  1. ITEM:长度(大小)和路径(带文件名的路径)

  2. 名称:要搜索的名称

  3. 片段长度:单个片段的长度(大小)
  4. 片段:SHA1这个torrent的每一部分的哈希

  5. 私有:限制访问的标志

为了展示这一点,我带了一个随机的torrent文件,并使用了来自Ultima的BEncode Editor,使它更加清晰。



正如您所看到的红色框标记了信息部分的torrent文件。
torrent文件不包含项目的哈希值,而是每个项目的哈希值。




  • 对于item1:1069496548

  • 和item2与:223

  • 它们在一起:1069496771 元件大小为:524288

  • 有2040件。 (2039,9032)

  • 片段包含40800字节的数据,文件中81600 + 2个字符。

  • +2因为0x标记这是十六进制的。

  • SHA1散列具有40个0x字符或20个字节的数据,2040个SHA1散列。





对不起,这些信息是关于导致非法电影的洪流,但我想用一个真正存在的洪流。


i am reading lately a lot about hash from torrents an magnetic links etc.

but there is a question i dont understand.

I have the hash of a file and the infohash of a torrent, is the infohash = hash of the file ?

If yes what if the torrent descripes 6 Files to download ?

If no what does it stand for.

解决方案

So I finally figured it out.

The "infohash" is the SHA1 Hash over the part of a torrent file that includes:

  1. ITEM: length(size) and path (path with filename)
  2. Name: The name to search for
  3. Piece length: The length(size) of a single piece
  4. Pieces: SHA1 Hash of EVERY piece of this torrent
  5. Private: flag for restricted access

To show this a little more I took a random torrent file and used the "BEncode Editor" from Ultima to make it more clearly to me.

As you can see the the red box marked the information part of the torrent file. The torrent file includes not the Hash of the items, but the hashes of every piece.

  • For item1 with: 1069496548
  • and item2 with: 223
  • It is together: 1069496771
  • With a piece size of: 524288
  • There are 2040 pieces. (2039,9032)
  • The pieces section includes 40800 byte of data what are 81600 + 2 chars in the file.
  • the +2 because 0x marks that this is hexadecimal.
  • A SHA1 hash has 40 0x chars or 20 Byte of data what are 2040 SHA1 hashes.

I am sorry that this information is about a torrent that leads to a illegal movie, but i wanted to use a torrent that realy exists.

这篇关于什么是torrent文件中的info_Hash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆