5 Aug
2013
5 Aug
'13
3:44 p.m.
I've just committed the code so you can try for yourself, but basically rather than storing a sequence of "limbs" (which may vary in size from one platform/compiler to another), it stores a sequence of bytes instead. The bytes are extracted using high level operations (shifts and bitmasks) so there's no issue with endianness etc.
As I said before - this shouldn't be necessary.
Consider a 128-bit integer type, internally this could be: * Expressed as 8 16-bit integers (intmax_t=32 bits). * Expressed as 4 32-bit integers (intmax_t=64 bits). * Expressed as a single 128-bit (native) integer. How would you serialize from one format to a different one without breaking it down into "portably small" chunks? John.