| 11027 | } |
| 11028 | |
| 11029 | std::string ipv4(const uint64_t address) noexcept { |
| 11030 | std::string output(15, '\0'); |
| 11031 | char* point = output.data(); |
| 11032 | char* point_end = output.data() + output.size(); |
| 11033 | point = std::to_chars(point, point_end, uint8_t(address >> 24)).ptr; |
| 11034 | for (int i = 2; i >= 0; i--) { |
| 11035 | *point++ = '.'; |
| 11036 | point = std::to_chars(point, point_end, uint8_t(address >> (i * 8))).ptr; |
| 11037 | } |
| 11038 | output.resize(point - output.data()); |
| 11039 | return output; |
| 11040 | } |
| 11041 | |
| 11042 | } // namespace ada::serializers |
| 11043 | /* end file src/serializers.cpp */ |
no test coverage detected