zson

binary JSON, compact and with support for streaming

ZSON - zipped streaming object notation

ZSON is a yet-another binary object notation similar to BSON or MessagePack. The difference from the two are that ZSON is designed to be streamable while being compact.

ZSON is licensed under the MIT License.

Tag Description
0xxxxxxx7-bit signed integer (-64 ~ +63)
10xxxxxx [byte]14-bit signed integer (-8192 ~ +8191)
110xxxxx [byte] [byte]21-bit signed integer (-1048576 ~ 1048575)
1110xxxx [byte] [byte] [byte]28-bit signed integer (-134217728 ~ 134217727)
11110000 [byte] [byte] [byte] [byte]32-bit signed integer
11110001 [byte] [byte] [byte] [byte]IEEE754 float (32-bit)
11110010 8*[byte]IEEE754 float (64-bit)
11110011null
11110100false
11110101true
11111100 n*[byte] 11111111UTF-8 string
11111101start of array
11111110start of object (list of value-key pairs, keys are raw UTF-8 strings terminated by 0xff)
11111111end of the current array or object
0xfc 0x68 0x65 0x6c 0x6c 0x6f 0xff                      -- "hello"
0xfd 0x01 0x7f 0x81 0x00 0xff                           -- [ 1, -1, 256 ]
0xfe 0xf5 0x63 0x6f 0x6d 0x70 0x61 0x63 0x64 0xff 0xff  -- {"compact":true}