package com.test;
import java.util.Scanner;
import java.io.*;
public class Test {
public static void main(String[] args) throws IOException {
int length = 16;
char[] c= new char[]{'a','b','c','d'};
int hash = proc(c);
System.out.println(hash);
hash ^= (hash >>> 20) ^ (hash >>> 12);
int h = hash ^ (hash >>> 7) ^ (hash >>> 4);
System.out.println(h);
int tmp = h &(length-1);
System.out.println(tmp);
}
public static int proc(char arg[]) {
int len =arg.length;
int off = 0;
int h=0;
for (int i = 0; i < len; i++) {
h = 31*h + arg[off++];
}
return h;
}
}