UBJSON
Universal Binary JSON (UBJSON) is a computer data interchange format. It is a binary form directly imitating JSON, but requiring fewer bytes of data. It aims to achieve the generality of JSON, combined with being much easier to process than JSON. Rationale and Objectives. UBJSON is a proposed successor to BSON, BJSON and others. UBJSON has the following goals: Data types and syntax. UBJSON data can be either a "value" or a "container". Value types. UBJSON uses a single binary tuple to represent all JSON value types: Each element in the tuple is defined as: type. The type is  a 1-byte ASCII character used to indicate the type of the data following it. The ASCII characters were chosen to make manually walking and debugging data stored in the UBJSON format as easy as possible (e.g. making the data relatively readable in a hex editor). Types are available for the five JSON value types. There is also a no-op type used for stream keep-alive. High-precision numbers are represented as an arbitrarily long, UTF-8 string-encoded numeric value. length (optional). The length is an integer number (e.g. uint8, or int64) encoding the size of the data payload  in bytes. It is used for strings, high-precision numbers and optionally containers. They are omitted for other types. Length is encoded following the same convention as integers, thus including its own type. For example, the string codice_15 is encoded as codice_14,codice_6,0x05,codice_18,codice_19,codice_8,codice_8,codice_22. data (optional). A sequence of bytes representing the actual binary data for this type of value. All numbers are in big-endian order. Container types. Similarly to JSON, UBJSON defines two container types: "array" and "object". Arrays are ordered sequences of elements, represented as a codice_23 followed by zero or more elements of value and container type and  a trailing codice_24. Objects are labeled sets of elements, represented as a codice_25 followed by zero or more key-value pairs and a trailing codice_26. Each key is a string with the codice_14 character omitted, and each "value" can be any element of value or container type. Alternatively, arrays and objects may indicate the number of elements they contain as codice_28 followed by an integer number before their first element, in which case the trailing codice_24 or codice_26 is omitted. Additionally, if all elements have the same type, the types can be omitted and replaced by a single codice_31 followed  by the type, in which case the element count must follow immediately. For example, the array <nowiki>["a","b","c"]</nowiki> may be represented as codice_23,codice_31,codice_13,codice_28,codice_6,0x03,codice_37,codice_38,codice_39. Binary data. While there is no explicit binary type, binary data is stored in a strongly typed array of uint8 values. This ensures binary efficiency while maintaining compatibility with JSON, even though JSON has no direct support for binary data. Representation. The MIME type 'application/ubjson' is recommended, as is the file extension '.ubj' when stored in a file-system.