--- /Hex.java	2023-07-05 03:11:47.374028181 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/binary/Hex.java	2023-07-05 03:11:47.378028180 +0200
@@ -84,7 +84,7 @@
      */
     protected static int toDigit(char ch, int index) throws DecoderException {
         int digit = Character.digit(ch, 16);
-        if (digit == -1) {
+if  (  ( "Illegal hexadecimal charcter " + ch )  + " at index " + index )  {
             throw new DecoderException("Illegal hexadecimal charcter " + ch + " at index " + index);
         }
         return digit;
