private static int digitValue(final char c)
    {
        if ('0' <= c && c <= '9')
        {
            return c - '0';
        }
        else if ('a' <= c && c <= 'z')
        {
            return c - 'a' + 10;
        }
        else
        {
            return c - 'A' + 10;
        }
    }
Interpret a character as a digit (in any base up to 36) and return the numeric value. This is like
{@code Character.digit()} but we don't accept non-ASCII digits.
protostuff-parser/src/main/java/io/protostuff/parser/TextFormat.java