-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFORMAT.txt
106 lines (94 loc) · 2 KB
/
FORMAT.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Types
Num
Uint
Uint8 / U8
Uint16 / U16
Uint32 / U32
Uint64 / U64
Int
Int8 / I8
Int16 / I16
Int32 / I32
Int64 / I64
Float16 / Half / F16
Float32 / Float / F32
Float64 / Double / F64
Float128 / Quad / F128
+Inf
-Inf
Nan
Utf8
Bool
Bin
Uint format.
Encode example for 0x01020304 number: 0x 04 06 08 88
one:
0-8 bytes : 0xxxxxxx
1 byte : 1xxxxxxx
list:
Uint bytes : Count
Uint bytes * Count : numbers
Utf8 format
one:
Uint bytes : Length
Length bytes : String
list:
Uint bytes : Count
Uint bytes \ * Count : Length
Length bytes / : string
Bool format.
Encode example for list [true, false, true, true]: 0x 84 b0
one:
1 bit index : true or false
list:
Uint bytes : Count
1+ bytes : Values
Int format.
one:
Uint bytes : number. If bit 6 in 7*N byte is set => negative number
list:
Uint bytes : Count
Uint bytes : number. If bit 6 in 7*N byte is set => negative number
Uint8,16,32,64 & Int8,16,32,64 format.
one:
1,2,4,8 bytes : number
list:
Uint bytes : Count
1,2,4,8 bytes * Count : number
Num format.
0 Uint8
1 Uint16
2 Uint32
3 Uint64
4 Int8
5 Int16
6 Int32
7 Int64
8 Float16
9 Float32
A Float64
B Float128
C +Inf
D -Inf
E Nan
one:
4 bits index : type (see above)
0-16 bytes : value
list:
Uint bytes : Count
4 bits index \ * Count : type
0-16 bytes / : value
Bin format.
one:
Uint bytes : Length
Length bytes : data
list:
Uint bytes : Count
Uint bytes \ * Count : Length
Length bytes / : data
Half,Float,Double,Quad format.
one:
2,4,8,16 bytes : number
list:
Uint bytes : Count
2,4,8,16 bytes * Count : numbers