FWIW here is Python's integer implementation. It essentially stores a length (
ob_size
, a general-purpose field that's being slightly abused for integers) and a block of uint32_t
of that length, whose bits represent the number.