Computes the hamming distance between two strings/arrays.