Additional struct packed byte type: 24-bit

I understand the 8, 16, 32, 64, and 128 bit data types in structs matches C libraries, but sometimes 24 bit numbers are stored in raw data that needs to be pulled from a structure.

StackOverflow has a few topics on 24-bit ints from bytes. Doing from_bytes and to_bytes feels heavy-handed, especially iterating over large struct arrays and dealing with signed/unsigned.

It would be beneficial to include 24-bit numbers in the structure packing/unpacking. Is this the right place to request this as a feature?

1 Like