Codec implementations for various map types.
For portability and consistency between architectures, the size of the map must fit within a u32.