Levenshtein distance
A more general way of measuring the number of bit errors is the Levenshtein distance.