public class HashDemo {
private static final int HASH_INCREMENT = 0x61c88647;
// private static final int HASH_INCREMENT = 1640531527;
public static void main(String[] args) {
//2的n次方
magicHash(2 *2*2*2*2);
// magicHash(32);
}
private static void magicHash(int size) {
int hashCode = 0;
for (int i = 0; i < size; i++) {
hashCode = i * HASH_INCREMENT + HASH_INCREMENT;
System.out.print((hashCode & (size - 1)) + " ");
}
System.out.println("");
}
}
0x61c88647
猜你喜欢
转载自blog.csdn.net/qq_36336332/article/details/109432757
今日推荐
周排行