#pragma once #include #include namespace mp::utils { template inline constexpr T GetNBytesMask(size_t bytes) { T res = 0; for (size_t i = 0; i < bytes; ++i) { res <<= 8; res |= 0xFF; } return res; } inline char HexDigit(uint8_t bits) { return bits > 9 ? 'a' + (bits - 10) : '0' + bits; } inline constexpr size_t AlignUp(size_t value, size_t alignment) { return (value + alignment - 1) / alignment * alignment; } } // namespace mp::utils