AsciiPack is an object serialization inspired by MessagePack.
AsciiPack is an object serialization inspired by MessagePack.
AsciiPack is use easy by Web. because all serialize object is only writed ascii strings.
JSON |
AsciiPack |
---|---|
JSON is 27 chars:
{"compact":true,"binary":0}
AsciiPack is 19 chars:
r2NcompactYMbinary0
r2 => map of length 2.
Ncompact => string of length 7 and value is "compact".
Y => true.
Mbinary => string of length 6 abd value is "binary".
0 => int value is 0.
format name | first char |
---|---|
int 4 | a |
int 8 | b |
int 16 | c |
int 32 | d |
int 64 | e |
(blank) | f |
uint 8 | g |
uint 16 | h |
uint 32 | i |
uint 64 | j |
float 32 | k |
float 64 | l |
(blank) | m |
bin 8 | n |
bin 16 | o |
bin 32 | p |
(blank) | q |
map 4 | r |
map 8 | s |
map 16 | t |
map 32 | u |
array 4 | v |
array 8 | w |
array 16 | x |
array 32 | y |
(blank) | z |
positive fixint | 0-9A-F |
fixbin | G-V |
nil | W |
false | X |
true | Y |
(blank) | Z |
All object serialize format.
key | [length] | [variable]
`F` is Hexadecimal number by one char.
`D` is Decimal number.
int 4:
a | F
int 8:
b | FF
int 16:
c | FFFF
int 32:
d | FFFFFFFF
int 64:
e | FFFFFFFFFFFFFFFF
positive fixint:
0-9A-F
uint 8:
g | FF
uint 16:
h | FFFF
uint 32:
i | FFFFFFFF
uint 64:
j | FFFFFFFFFFFFFFFF
Value abide IEEE 754 format.
float 32:
k | FFFFFFFF
float 64:
l | FFFFFFFFFFFFFFFF
fixbin:
G-V | data
bin 8:
n | FF | data
bin 16:
o | FFFF | data
bin 32:
p | FFFFFFFF | data
map 4:
r | F | N * (key + value)
map 8:
s | FF | N * (key + value)
map 16:
t | FFFF | N * (key + value)
map 32:
u | FFFFFFFF | N * (key + value)
* N is the size of map
array 4:
v | F | N * value
array 8:
w | FF | N * value
array 16:
x | FFFF | N * value
array 32:
y | FFFFFFFF | N * value
* N is the size of array
nil:
W
false:
X
true:
Y
Serializer | Length | Speed | Readability |
---|---|---|---|
JSON | × | △ | ○ |
MessagePack | ○ | ○ | × |
AsciiPack | △ | × | △ |