Search for Best Torrents

Loading
Cheap Canon Lenses

Jul 21, 2014

Torrent file format


A torrent file contains semi-text, semi-binary data in so-called Bencoding format. Each item can be an integer, a string, an onordered list and a dictionary with key/value pairs (ordered by keys). Each item starts with a single letter except for strings (i, l, d for integers, lists and dictionaries correspondingly) and ends with letter «e». Integers are encoded in torrent files as i52e (number 52); Strings are stored as 10:bittorrent (length + colon + the string itself) in torrent files; Lists are simply recursively encoded values so it's like li123e4:worde that represents 2 items: a number 123 and a string «word»; Dicrionaries are similar to lists except they start with letter d and have a bencoded string before each value. Both lists and dictionaries can be nested; dictionaries must be sorted by keys.

No comments: