Hamming distance function complete.