MCPcopy Create free account
hub / github.com/apache/arrow / ParseHexValue

Function ParseHexValue

cpp/src/arrow/util/string.cc:82–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82Status ParseHexValue(const char* data, uint8_t* out) {
83 uint8_t high = ParseHexDigit(data[0]);
84 uint8_t low = ParseHexDigit(data[1]);
85
86 // Error checking
87 if (high == kInvalidHexDigit || low == kInvalidHexDigit) {
88 return Status::Invalid("Encountered non-hex digit");
89 }
90
91 *out = static_cast<uint8_t>(high << 4 | low);
92 return Status::OK();
93}
94
95Status ParseHexValues(std::string_view hex_string, uint8_t* out) {
96 if (hex_string.size() % 2 != 0) {

Callers 3

ARROW_ASSIGN_OR_RAISEFunction · 0.85
TESTFunction · 0.85
ParseHexValuesFunction · 0.85

Calls 3

ParseHexDigitFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50

Tested by 1

TESTFunction · 0.68