Add hamming distance and similarity functions