翻訳と辞書
Words near each other
・ Benchmarking (geolocating)
・ Benchmarking (journal)
・ Benchmarking e-learning
・ Bencho Obreshkov
・ BenchPrep
・ Benchrest rifle
・ Benchrest shooting
・ Benchtop nuclear magnetic resonance spectrometer
・ BenchWarmers DVD Magazine
・ Benchō
・ Bencini
・ Bencion
・ Bencivenga
・ Benclare, South Dakota
・ Benco Dental
Bencode
・ Bencombe
・ Bencomia
・ Bencomo
・ Bencoolen
・ Bencoolen MRT Station
・ Bencoolen Street
・ Bencorr
・ Bencroft Hill Meadows
・ Bencubbin, Western Australia
・ Bencyclane
・ Bend
・ Bend & Break (Grey's Anatomy)
・ Bend (album)
・ Bend (heraldry)


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Bencode : ウィキペディア英語版
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:
* byte strings,
* integers,
* lists, and
* dictionaries (associative arrays).
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.
* An integer is encoded as i''ASCII>''e. Leading zeros are not allowed (although the number zero is still represented as "0"). Negative values are encoded by prefixing the number with a minus sign. The number 42 would thus be encoded as , 0 as , and -42 as . Negative zero is not permitted.
* A byte string (a sequence of bytes, not necessarily characters) is encoded as '''':''''. The length is encoded in base 10, like integers, but must be non-negative (zero is allowed); the contents are just the bytes that make up the string. The string "spam" would be encoded as . The specification does not deal with encoding of characters outside the ASCII set; to mitigate this, some BitTorrent applications explicitly communicate the encoding (most commonly UTF-8) in various non-standard ways. This is identical to how netstrings work, except that netstrings additionally append a comma suffix after the byte sequence.
* A list of values is encoded as l''''e . The contents consist of the bencoded elements of the list, in order, concatenated. A list consisting of the string "spam" and the number 42 would be encoded as: . Note the absence of separators between elements.
* A dictionary is encoded as d''''e. The elements of the dictionary are encoded each key immediately followed by its value. All keys must be byte strings and must appear in lexicographical order. A dictionary that associates the values 42 and "spam" with the keys "foo" and "bar", respectively (in other words, }}}), would be encoded as follows: . (This might be easier to read by inserting some spaces: .)
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.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Bencode」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.