public static int hashCode(byte[] bytes, int offset, int length) {
    int hash = 1;
    for (int i = offset; i < offset + length; i++)
      hash = (31 * hash) + bytes[i];
    return hash;
  }
Calculate the hash code for a given range of bytes.
@param bytes  array to hash
@param offset offset to start from
@param length length to hash
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java