Change calculateHammingDistance signature