use size_t for lengths also for MemToHex/HexToMem