I'm curious about why we need to store the length of ext data in a separate bit when it's actually very small (like the timestamp 96 format), thus I propose a more compact fixext format (replacing fixext 1 ~ 16):
fixext stores an integer and a byte array whose length is up to 16 bytes
+--------+--------+===============+
| 0xd4 |XXXXYYYY| N-byte data |
+--------+--------+===============+
where
* XXXX is a 4-bit unsigned integer which represents N
* YYYY is a 4-bit signed integer which represents the ext type
By this format, we can combine fixext 1, 2, 4, 8, 16 into one single format and release more options for first level types. In addition we don't need a separate byte to store the length if the size of binary data is 3, 12, etc. The only drawback for this format is that it limits ext type to -7~8. If users want to use ext type out of this range, they should use ext 8 type.
I'm curious about why we need to store the length of ext data in a separate bit when it's actually very small (like the timestamp 96 format), thus I propose a more compact fixext format (replacing fixext 1 ~ 16):
By this format, we can combine fixext 1, 2, 4, 8, 16 into one single format and release more options for first level types. In addition we don't need a separate byte to store the length if the size of binary data is 3, 12, etc. The only drawback for this format is that it limits ext type to -7~8. If users want to use ext type out of this range, they should use ext 8 type.