I'm trying to parse a binary file that has a combination of 1,2,4,8 byte integers and 4,8 byte floating points as well as varying strings with different encodings. How do I convert 4 bytes or 8 bytes to a floating point?
Is using the struct package the best way? if so, how do I use the struct package to get a floating point? with 4-bytes and 8-bytes
How could i do the same thing with a 2-byte or 4-byte integer? What i'm currently using is
int.from_bytes(binary_file.read(2), byteorder='little', signed=False)
int.from_bytes(binary_file.read(4), byteorder='little', signed=False)
Would it be more optimal to use struct for multiple ints and floats in succession?