MCPcopy Create free account
hub / github.com/78/tenbox / EncodeHex

Function EncodeHex

src/runtime/runtime_service.cpp:225–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225std::string EncodeHex(const uint8_t* data, size_t size) {
226 static constexpr char kDigits[] = "0123456789abcdef";
227 std::string out;
228 out.resize(size * 2);
229 for (size_t i = 0; i < size; ++i) {
230 out[2 * i] = kDigits[(data[i] >> 4) & 0x0F];
231 out[2 * i + 1] = kDigits[data[i] & 0x0F];
232 }
233 return out;
234}
235
236std::vector<uint8_t> DecodeHex(const std::string& value) {
237 auto hex = [](char ch) -> int {

Callers 1

FlushConsoleDataMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected