int8_t Int8FromHexAscii()

in src/Windows/curl_easy.cpp [397:417]


int8_t Int8FromHexAscii(char ch)
{
    int8_t byteValue;
    if (ch >= '0' && ch <= '9')
    {
        byteValue = (ch - '0');
    }
    else if (ch >= 'a' && ch <= 'f')
    {
        byteValue = (ch - 'a') + 10;
    }
    else if (ch >= 'A' && ch <= 'F')
    {
        byteValue = (ch - 'A') + 10;
    }
    else
    {
        byteValue = -1;
    }
    return byteValue;
}