0

How can I convert 3 and 6 byte big-endian two's complement Python bytes instances to Python ints?

I was hoping to use struct, but looking at https://docs.python.org/3/library/struct.html#format-characters, there are no 3 or 6 byte-long sizes.

Context: writing code to parse SQLite files, and it uses this representation in some cases https://www.sqlite.org/fileformat.html#record_format

Michal Charemza
  • 25,940
  • 14
  • 98
  • 165

0 Answers0