sharksforarms / deku

Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Apache License 2.0
1.14k stars 55 forks source link

Variable length integer? #469

Closed yanshay closed 2 months ago

yanshay commented 2 months ago

Is there a way to specify that the number of bytes (or bits) of an integer is an expression? So for example, to specify that the length depends on a preceding bit somewhere in the structure? if it is 1 then the integer is u32 otherwise it is u8?