Read in each character one by one and convert it to a hex value (which is pretty easy).
You then need to, before reading the next number multiply the value by 16 (or, indeed, shift it left by 4) and read the next digit before adding it to the number you have so far. Keep going until you reach the end of your string.
When someone asks if they inputs are ASCII they are referring to whether your hex string is encoded using ASCII encoding. There are, equally various other encoding methods that range from the obsolete EBCDIC to the far more modern Unicode (which has different encodings which are still all unicode).
Bear in mind that the numbers 0 to 9, a to f and A to F have ASCII (or indeed unicode) values that are after one another in the encoding. So for numbers you can calculate its REAL value by doing "character - '0'". For 0 this will give you 0 and up to 9 it will give you 9 ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…