util/CharUtil: add IsHexDigit()

This commit is contained in:
Max Kellermann 2020-04-06 12:59:33 +02:00
parent dd37b4656e
commit cc3e71d8c7

View File

@ -130,4 +130,12 @@ ToLowerASCII(char ch) noexcept
: ch;
}
constexpr bool
IsHexDigit(char ch) noexcept
{
return IsDigitASCII(ch) ||
(ch >= 'a' && ch <= 'f') ||
(ch >= 'A' && ch <= 'F');
}
#endif