Bencode

Bencode (pronounced like B encode) is the encoding used by the peer-to-peer file sharing system BitTorrent for storing and transmitting loosely structured data.

It supports four different types of values:

Bencoding is most commonly used in torrent files. These metadata files are simply bencoded dictionaries.

While less efficient than a pure binary encoding, bencoding is simple and (because numbers are encoded as text in decimal notation) is unaffected by endianness, which is important for a cross-platform application like BitTorrent. It is also fairly flexible, as long as applications ignore unexpected dictionary keys, so that new ones can be added without creating incompatibilities.

Encoding algorithm

Bencode uses ASCII characters as delimiters and digits.

There are no restrictions on what kind of values may be stored in lists and dictionaries; they may (and usually do) contain other lists and dictionaries. This allows for arbitrarily complex data structures to be encoded.

Features & drawbacks

Bencode is a very specialized kind of binary coding with some unique properties:

However, this uniqueness can cause some problems:

See also

References

  1. "BEncode Editor". µTorrent Community Forums. Retrieved 24 October 2014.

External links

This article is issued from Wikipedia - version of the 10/14/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.