MCPcopy Create free account
hub / github.com/Norbyte/ositools / CharToByte

Function CharToByte

OsiInterface/DataLibraries.cpp:18–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 bool GlobalStringTable::UseMurmur = false;
17
18 uint8_t CharToByte(char c)
19 {
20 if (c >= '0' && c <= '9') {
21 return c - '0';
22 }
23 else if (c >= 'A' && c <= 'F') {
24 return c - 'A' + 0x0A;
25 }
26 else if (c >= 'a' && c <= 'f') {
27 return c - 'a' + 0x0A;
28 }
29 else {
30 Fail("Invalid hexadecimal character");
31 }
32 }
33
34 uint8_t HexByteToByte(char c1, char c2)
35 {

Callers 1

HexByteToByteFunction · 0.85

Calls 1

FailFunction · 0.70

Tested by

no test coverage detected