in hpack/src/main/java/com/twitter/hpack/Encoder.java [393:405]
private static int hash(byte[] name) {
int h = 0;
for (int i = 0; i < name.length; i++) {
h = 31 * h + name[i];
}
if (h > 0) {
return h;
} else if (h == Integer.MIN_VALUE) {
return Integer.MAX_VALUE;
} else {
return -h;
}
}