Bit array parsing and encoding utility library in C