Support unambiguous variable length integer mappings where builder automatically selects narrowest width case based on value of primitive.
Builder should also support explicitly specifying a wider type.
variant UnsignedInt switch (uint8) of uint32
{
case 0x04: uint32;
case 0x01: uint8;
case 0x00: 0;
}
In each case, the uint8 case value prefixes the actual value, except for case 0 where the 0 literal is implied by the case prefix without also needing to explicitly encode the 0 value.
Therefore the following byte sequences could all represent a primitive value of zero for UnsignedInt.
Support unambiguous variable length integer mappings where builder automatically selects narrowest width case based on value of primitive.
Builder should also support explicitly specifying a wider type.
In each case, the
uint8
case value prefixes the actual value, except forcase 0
where the0
literal is implied by the case prefix without also needing to explicitly encode the0
value.Therefore the following byte sequences could all represent a primitive value of zero for
UnsignedInt
.