资 源 简 介
Binary Object Notation, bon, is similar to JavaScript Object Notation, json, excepts it produces binary output. bon produces almost minimal but yet powerful and intuitive representation. It can be used as a protocol format, too.
Compared to Python object serialization modules marshal and pickle, bon creates ~30% smaller then marshal and ~50% then pickle smaller output.
Python Example:
```
from bon import dumps, loads
a = dumps({
0: [None, True, False, -(2 ** 8), 2 ** 16 - 1, 2 ** 32 - 1, -0.12345, "a", "abcde"],
1: [(u"xeexff", "qwerty", {})], 2:None, 3:False, 4:True, 5:-0.12345678901234567890
})
print "serialized in", len(a), "bytes:", repr(a)
b = loads(a)
print b
```