In Python, long integers have unlimited precision. I would like to write a 16 byte (128 bit) integer to a file. struct
from the standard library supports only u
You could pickle the object to binary, use protocol buffers (I don't know if they allow you to serialize unlimited precision integers though) or BSON if you do not want to write code.
But writing a function that dumps 16 byte integers by shifting it should not be so hard to do if it's not time critical.