in src/main/java/org/apache/commons/codec/digest/XXHash32.java [93:123]
public long getValue() {
int hash;
if (stateUpdated) {
// Hash with the state
hash =
rotateLeft(state[0], 1) +
rotateLeft(state[1], 7) +
rotateLeft(state[2], 12) +
rotateLeft(state[3], 18);
} else {
// Hash using the original seed from position 2
hash = state[2] + PRIME5;
}
hash += totalLen;
int idx = 0;
final int limit = pos - 4;
for (; idx <= limit; idx += 4) {
hash = rotateLeft(hash + getInt(buffer, idx) * PRIME3, 17) * PRIME4;
}
while (idx < pos) {
hash = rotateLeft(hash + (buffer[idx++] & 0xff) * PRIME5, 11) * PRIME1;
}
hash ^= hash >>> 15;
hash *= PRIME2;
hash ^= hash >>> 13;
hash *= PRIME3;
hash ^= hash >>> 16;
return hash & 0xffffffffL;
}