I’ve also just stored byte arrays as their corresponding integer and used the functions std.mem.toBytes()
and std.mem.bytesToValue()
to change them to/from arrays as needed.
So in your case something like:
const BoardInfo = packed struct {
/// Board ID. 8 * 8b
board_id: u64,
/// Serial Number. 6 * 8b
serial_number: u48,
/// Rest of the struct...
}
This was neater and easier to manage for my use case, but I think that just depends on what you’re doing.