public static int compareVersion(String v1, String v2) {
    // fast compare equals first
    if (v1.equals(v2)) {
      return 0;
    }
    String[] v1Comps = getVersionComponents(v1);
    String[] v2Comps = getVersionComponents(v2);

    int length = Math.max(v1Comps.length, v2Comps.length);
    for (int i = 0; i < length; i++) {
      Integer va = i < v1Comps.length ? Integer.parseInt(v1Comps[i]) : 0;
      Integer vb = i < v2Comps.length ? Integer.parseInt(v2Comps[i]) : 0;
      int compare = va.compareTo(vb);
      if (compare != 0) {
        return compare;
      }
    }
    return 0;
  }
Get the checksum of the source files from which Hadoop was compiled.
@return a string that uniquely identifies the source
hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java