Skip to content

Commit 9c10aa5

Browse files
committed
Update README.md
1 parent b348c08 commit 9c10aa5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ Each integer number must be serialized in little-endian format.
210210
The sproto message must be a user defined type struct, and a struct is encoded in three parts. The header, the field part, and the data part.
211211
The tag and small integer or boolean will be encoded in field part, and others are in data part.
212212

213-
All the fields must be encoded in ascending order (by tag). The tags of fields can be discontinuous, if a field is nil. (default value in lua), don't encode it in message.
213+
All the fields must be encoded in ascending order (by tag, base 0). The tags of fields can be discontinuous, if a field is nil. (default value in lua), don't encode it in message.
214214

215215
The header is a 16bit integer. It is the number of fields.
216216

217217
Each field in field part is a 16bit integer (n). If n is zero, that means the field data is encoded in data part ;
218218

219-
If n is even (and not zero), the value of this field is n/2-1 ;
219+
If n is even (and not zero), the value of this field is n/2-1 , and the tag increases 1;
220220

221221
If n is odd, that means the tags is not continuous, and we should add current tag by (n+1)/2 .
222222

0 commit comments

Comments
 (0)