int (byte[] value) { int hash = 0; // take first 4 bytes, this should be good enough hash given we reference git revisions with 7-8 hex digits for (int i = 0; i < 4; ++i) { hash = (hash << 8) + (value[i] & 0xFF); } return hash; }