Currently, the maximum size of a KeyString is limited to ~1KB so it's enough that the TypeBits is a 128-byte fixed size uint8_t array. Now that we want to remove the size limit of KeyString, TypeBits needs to be extended. The work of this ticket include:
- Change the fixed size array to a varied size buffer in TypeBits.
- Extend the encode scheme to represent TypeBits more than 127 bytes. Currently, only the first element of the array is the size byte which can only represent the size of TypeBits between 0 and 127 bytes. We want to use 4 bytes to represent the size now. Detailed design can be found in the design doc.