Info Hash

Network Identifiers

BitTorrent uses a content identifier calculated from the `info` dictionary in the torrent metadata to distinguish distribution tasks, establish peer-to-peer connections, and locate members of the same group on trackers or in the DHT.

Explanation

信息哈希 (Info Hash) is a hash value used by BitTorrent to identify torrent metadata and the corresponding download group. Clients use it during handshakes, tracker requests, and distributed hash table queries to ensure that nodes with the same metadata join the same swarm. 信息哈希 is not a number assigned by a website, nor is it a simple hash of a file name string.

In BitTorrent v1, the info hash is the SHA-1 digest of the raw bencode-encoded `info` dictionary within the `.torrent` metadata file. It is 20 bytes long and is typically displayed as 40 hexadecimal characters or Base32 text. The `info` dictionary contains fields such as the suggested name, file length or file list, chunk length, and the SHA-1 of each chunk. Any change at the encoding level to this dictionary may result in a new 信息哈希; tracker addresses or comments located outside the `info` dictionary are generally not included in the v1 hash.

信息哈希 identifies a specific set of metadata, rather than all files that are “content-identical” in an abstract sense. Even if two publishers use the same files, they will form different swarms as long as the chunk sizes, directory names, file order, or other fields within `info` differ. Conversely, after obtaining the metadata, clients will still verify the downloaded data using piece hashes; 信息哈希 itself does not replace the integrity checks for each piece. BitTorrent v2 is defined by BEP 52, which uses SHA-256 to compute the v2 info hash and organizes file integrity information using a Merkle tree. Compatible hybrid torrents can contain both the structures required by v1 and v2, and therefore have both corresponding identifiers. Simply referring to an “info hash” without specifying the protocol version may not fully describe a modern torrent.

信息哈希 does not contain data that can be directly downloaded, nor does it guarantee the current availability of seeders. It may appear in `.torrent` files, Magnet URIs, client interfaces, and databases; Clients must also locate nodes via trackers, DHT, PEX, or other means to obtain metadata and file fragments. Hash values do not provide authentication regarding the publisher’s identity, copyright status, or file security.