MCPcopy Create free account
hub / github.com/apple/foundationdb / hexValue

Function hexValue

FDBLibTLS/FDBLibTLSVerify.cpp:32–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#include <cstring>
31
32static int hexValue(char c) {
33 static char const digits[] = "0123456789ABCDEF";
34
35 if (c >= 'a' && c <= 'f')
36 c -= ('a' - 'A');
37
38 int value = std::find(digits, digits + 16, c) - digits;
39 if (value >= 16) {
40 throw std::runtime_error("hexValue");
41 }
42 return value;
43}
44
45// Does not handle "raw" form (e.g. #28C4D1), only escaped text
46static std::string de4514(std::string const& input, int start, int& out_end) {

Callers 1

de4514Function · 0.70

Calls 1

findFunction · 0.85

Tested by

no test coverage detected