Changeset 6920


Ignore:
Timestamp:
Oct 16, 2008, 5:56:17 PM (13 years ago)
Author:
charles
Message:

make the json/benc mapping a little more explicit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/rpc-spec.txt

    r6913 r6920  
    661.1  Terminology
    77
    8    The JSON terminology in RFC 4627 is used. "array" is equivalent
    9    to a benc list; "object" is equivalent to a benc dictionary;
    10    and an object's "keys" are the dictionary's string keys.
     8   The JSON terminology in RFC 4627 is used.
     9
     10   In benc terms, a JSON "array" is equivalent to a benc list,
     11   a JSON "object" is equivalent to a benc dictionary,
     12   and a JSON object's "keys" are the dictionary's string keys.
    1113
    12142.  Message Format
    1315
    1416   Messages are formatted in a subset of JSON easily represented
    15    as bencoded data -- arrays, objects, strings, and whole numbers.
    16    Booleans are represented as numbers where 0 is false and 1 is true.
     17   as bencoded data.  Arrays, objects, strings, and whole numbers
     18   all have one-to-one mappings between JSON and benc.
     19
     20   Booleans and floating-point numbers are also used in the JSON messages.
     21   Those two types aren't native to benc, so they're encoded this way:
     22   Booleans are encoded as numbers where 0 is false and 1 is true.
    1723   Floating-point numbers are represented as strings.
    1824
Note: See TracChangeset for help on using the changeset viewer.