code: public static char decodeHexPair(char c1, char c2) {
          char ret = 0;
          if (c1 >= '0' && c1 <= '9') {
              ret |= c1-'0';
          } else if (c1 >= 'a' && c1 <= 'f') {
              ret |= c1-'a'+10;
          } else if (c1 >= 'A' && c1 <= 'F') {
              ret |= c1-'A'+10;
          } else {
              return INVALID_HEX;
          }
          ret <<= 4;
          if (c2 >= '0' && c2 <= '9') {
              ret |= c2-'0';
          } else if (c2 >= 'a' && c2 <= 'f') {
              ret |= c2-'a'+10;
          } else if (c2 >= 'A' && c2 <= 'F') {
              ret |= c2-'A'+10;
          } else {
              return INVALID_HEX;
          }
          return ret;
      }
docs: /*
  Decodes given hex pair into char
  Example - decodeHexPair('3','A') returns ':'