MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / parse_hex_digit

Function parse_hex_digit

modules/core/base/src/SkrBase/build.md5.cpp:5–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "SkrBase/misc/debug.h"
4
5constexpr int parse_hex_digit(const char8_t c)
6{
7 if (u8'0' <= c && c <= u8'9')
8 return c - u8'0';
9 else if (u8'a' <= c && c <= u8'f')
10 return 10 + c - u8'a';
11 else if (u8'A' <= c && c <= u8'F')
12 return 10 + c - u8'A';
13 else
14 SKR_ASSERT((c == u8'0') && false && u8"Invalid character in GUID. Expected hex digit");
15 return -1;
16}
17
18template <class T>
19bool parse_hex(const char8_t* ptr, T& value)

Callers 1

parse_hexFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected