caculate the integervalue of hexString