private static int hashCodeOf(byte[] contentHash) {
    //Just use contentHash[0..3] as hash code (int32)
    //Why we expect it to be good enough hash-code: we just rely on crypto-hash being a good
    // (regular) hash: spreading set of contents over all possible hash bytes uniformly -- which
    // means each byte of contentHash should have all values with equal probability
    //Simple practical reasoning: in most git repositories we could refer revisions with the only
    // first 7-8 hex digits (~4bytes) of crypto-hash -- i.e. those first 4 bytes of crypto-hash are
    // unique across many millions file revisions.
    int hashCode = 0;
    for (int i = 0; i < 4; i++) {
      hashCode = (hashCode << 8) + (contentHash[i] & 0xFF);
    }
    return hashCode;
  }
private static int hashCodeOf(byte[] contentHash)