maxDist test for hamming distance