title: How to compute a distance between two byte arrays?
body: <p>I need to calculate the distance between two byte arrays of the same length. In particular, I am looking for approach to obtain a distance with the following features:</p>
  
  <ul>
  <li>if the two arrays are very similar to each other, then the distance should be very small;</li>
  <li>otherwise, the distance should be very large.</li>
  </ul>
  
  <p>Basically, I'm looking for a way to measure the difference between two arrays.</p>
  
  <p><strong>UPDATE</strong>: As suggested, I provide the following additional information about the content of a byte array. A sequence of bytes contains the features of an image, so an image is divided into small regions, and some color information is measured for each region (each byte encodes information relating to a single region): when a bit is set within a byte, then it means that a given feature is present within the region.</p>
  
  <p>Therefore, given two sequences of bytes, I would like to compare using a suitable distance measure. I read about Bhattacharyya distance, but I do not know how to apply it in this case, so I was wondering if there were other distance measures to compare two byte arrays.</p>