---
id: "torrent_info_hash"
kind: "datatype"
status: "stable"
is_pii: false
categories: ["internet", "identifiers", "cryptography"]
langs: ["common"]
quality: 90
url: "http://registry.apicrafter.io/datatype/torrent_info_hash"
---

# BitTorrent Info Hash (BTIH) (`torrent_info_hash`)

Identifier of a torrent: the hash of the bencoded info dictionary of its .torrent file. Version 1 torrents (BEP 3) use SHA-1, written as 40 hexadecimal digits, as in magnet:?xt=urn:btih: links; old magnet links may carry the same 20 bytes as 32 Base32 characters, which the regexp does not cover. Version 2 torrents (BEP 52) use a SHA-256 info hash, written as a multihash in urn:btmh: links.

- Parent datatype: `sha1hash`
- Personal data (PII): no
- Categories: Internet (internet), Universal unique identifiers (identifiers), Cryptographic identifiers (cryptography)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[0-9a-fA-F]{40}$
```

## Examples

- `dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c` — Info hash of the Big Buck Bunny torrent published by WebTorrent
- `08ada5a7a6183aae1e09d831df6748d566095a10` — Info hash of the Sintel torrent published by WebTorrent
- `DD8255ECDC7CA55FB0BBF81323D87062DB1F6D1C` — The Big Buck Bunny info hash in uppercase
- `dd8255ecdc7ca55fb0bbf81323d87062db1f6d1` (invalid example) — one hex digit short (39 instead of 40)

## Metacrafter rules

2 rules: 1 match the field name, 1 match values.

- `torrentinfohashfield` (field, `common/internet.yaml`)
- `torrentinfohashvalue` (data, `common/internet.yaml`)

## Supported by tools

- `metacrafter`

## Translations

- ru: Хеш info торрента (BTIH): Идентификатор торрента: SHA-1-хеш словаря info файла .torrent, 40 шестнадцатеричных цифр.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/BitTorrent>
- doc: <https://www.bittorrent.org/beps/bep_0003.html>
- doc: <https://www.bittorrent.org/beps/bep_0009.html>
- doc: <https://www.bittorrent.org/beps/bep_0052.html>

## Quality

Score 90/100. Missing: mapping (Wikidata, Schema.org, ...).

JSON: <http://registry.apicrafter.io/api/v1/datatypes/torrent_info_hash.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/torrent_info_hash.yaml>
