Implement hamming distance and tests for it