示例#1
0
 @Test
 public void testHash32ByteArrayIntInt() {
   for (int i = 0; i < input.length; i++) {
     final int hash = MurmurHash.hash32(input[i], input[i].length, 0x71b4954d);
     if (hash != results32_seed[i]) {
       fail(
           String.format(
               "Unexpected hash32 result for example %d: 0x%08x instead of 0x%08x",
               i, hash, results32_seed[i]));
     }
   }
 }
示例#2
0
 @Test
 public void testHash32StringIntInt() {
   final int hash = MurmurHash.hash32(text, 2, text.length() - 4);
   assertTrue(hash == 0x4d666d90);
 }
示例#3
0
 @Test
 public void testHash32String() {
   final int hash = MurmurHash.hash32(text);
   assertTrue(hash == 0xb3bf597e);
 }