Esempio n. 1
0
 // goodFastHash(128) uses Murmur3_128. Use the same epsilon bounds.
 public void testGoodFastHash128() {
   HashTestUtils.check2BitAvalanche(Hashing.goodFastHash(128), 250, 0.20);
   HashTestUtils.checkAvalanche(Hashing.goodFastHash(128), 250, 0.17);
   HashTestUtils.checkNo2BitCharacteristics(Hashing.goodFastHash(128));
   HashTestUtils.checkNoFunnels(Hashing.goodFastHash(128));
   HashTestUtils.assertInvariants(Hashing.goodFastHash(128));
 }
Esempio n. 2
0
 public void testMurmur3_32() {
   HashTestUtils.check2BitAvalanche(Hashing.murmur3_32(), 250, 0.20);
   HashTestUtils.checkAvalanche(Hashing.murmur3_32(), 250, 0.17);
   HashTestUtils.checkNo2BitCharacteristics(Hashing.murmur3_32());
   HashTestUtils.checkNoFunnels(Hashing.murmur3_32());
   HashTestUtils.assertInvariants(Hashing.murmur3_32());
 }
 public void testHashing() {
   for (String stringToTest : INPUTS) {
     for (String algorithmToTest : ALGORITHMS.keySet()) {
       assertMessageDigestHashing(HashTestUtils.ascii(stringToTest), algorithmToTest);
     }
   }
 }
Esempio n. 4
0
 public void testGoodFastHash() {
   for (int i = 1; i < 200; i += 17) {
     HashFunction hasher = Hashing.goodFastHash(i);
     assertTrue(hasher.bits() >= i);
     HashTestUtils.assertInvariants(hasher);
   }
 }
Esempio n. 5
0
 public void testSha512() {
   HashTestUtils.checkAvalanche(Hashing.sha512(), 100, 0.4);
   HashTestUtils.checkNo2BitCharacteristics(Hashing.sha512());
   HashTestUtils.checkNoFunnels(Hashing.sha512());
   HashTestUtils.assertInvariants(Hashing.sha512());
 }