Skip to content

Proposal: a compact fixext field, replacing fixext 1~16 #310

Description

@cmpute

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions