Java 类com.google.common.hash.HashTestUtils.HashFn 实例源码

项目:guava-mock    文件:Murmur3Hash128Test.java   
public void testParanoid() {
  HashFn hf = new HashFn() {
    @Override public byte[] hash(byte[] input, int seed) {
      Hasher hasher = murmur3_128(seed).newHasher();
      Funnels.byteArrayFunnel().funnel(input, hasher);
      return hasher.hash().asBytes();
    }
  };
  // Murmur3F, MurmurHash3 for x64, 128-bit (MurmurHash3_x64_128)
  // From http://code.google.com/p/smhasher/source/browse/trunk/main.cpp
  HashTestUtils.verifyHashFunction(hf, 128, 0x6384BA69);
}
项目:guava-mock    文件:Murmur3Hash32Test.java   
public void testParanoid() {
  HashFn hf = new HashFn() {
    @Override public byte[] hash(byte[] input, int seed) {
      Hasher hasher = murmur3_32(seed).newHasher();
      Funnels.byteArrayFunnel().funnel(input, hasher);
      return hasher.hash().asBytes();
    }
  };
  // Murmur3A, MurmurHash3 for x86, 32-bit (MurmurHash3_x86_32)
  // http://code.google.com/p/smhasher/source/browse/trunk/main.cpp
  HashTestUtils.verifyHashFunction(hf, 32, 0xB0F57EE3);
}
项目:googles-monorepo-demo    文件:Murmur3Hash128Test.java   
public void testParanoid() {
  HashFn hf = new HashFn() {
    @Override public byte[] hash(byte[] input, int seed) {
      Hasher hasher = murmur3_128(seed).newHasher();
      Funnels.byteArrayFunnel().funnel(input, hasher);
      return hasher.hash().asBytes();
    }
  };
  // Murmur3F, MurmurHash3 for x64, 128-bit (MurmurHash3_x64_128)
  // From http://code.google.com/p/smhasher/source/browse/trunk/main.cpp
  HashTestUtils.verifyHashFunction(hf, 128, 0x6384BA69);
}
项目:googles-monorepo-demo    文件:Murmur3Hash32Test.java   
public void testParanoid() {
  HashFn hf = new HashFn() {
    @Override public byte[] hash(byte[] input, int seed) {
      Hasher hasher = murmur3_32(seed).newHasher();
      Funnels.byteArrayFunnel().funnel(input, hasher);
      return hasher.hash().asBytes();
    }
  };
  // Murmur3A, MurmurHash3 for x86, 32-bit (MurmurHash3_x86_32)
  // http://code.google.com/p/smhasher/source/browse/trunk/main.cpp
  HashTestUtils.verifyHashFunction(hf, 32, 0xB0F57EE3);
}
项目:guava-libraries    文件:Murmur3Hash128Test.java   
public void testParanoid() {
  HashFn hf = new HashFn() {
    @Override public byte[] hash(byte[] input, int seed) {
      Hasher hasher = murmur3_128(seed).newHasher();
      Funnels.byteArrayFunnel().funnel(input, hasher);
      return hasher.hash().asBytes();
    }
  };
  // Murmur3F, MurmurHash3 for x64, 128-bit (MurmurHash3_x64_128)
  // From http://code.google.com/p/smhasher/source/browse/trunk/main.cpp
  HashTestUtils.verifyHashFunction(hf, 128, 0x6384BA69);
}
项目:guava-libraries    文件:Murmur3Hash32Test.java   
public void testParanoid() {
  HashFn hf = new HashFn() {
    @Override public byte[] hash(byte[] input, int seed) {
      Hasher hasher = murmur3_32(seed).newHasher();
      Funnels.byteArrayFunnel().funnel(input, hasher);
      return hasher.hash().asBytes();
    }
  };
  // Murmur3A, MurmurHash3 for x86, 32-bit (MurmurHash3_x86_32)
  // http://code.google.com/p/smhasher/source/browse/trunk/main.cpp
  HashTestUtils.verifyHashFunction(hf, 32, 0xB0F57EE3);
}
项目:guava    文件:Murmur3Hash128Test.java   
public void testParanoid() {
  HashFn hf =
      new HashFn() {
        @Override
        public byte[] hash(byte[] input, int seed) {
          Hasher hasher = murmur3_128(seed).newHasher();
          Funnels.byteArrayFunnel().funnel(input, hasher);
          return hasher.hash().asBytes();
        }
      };
  // Murmur3F, MurmurHash3 for x64, 128-bit (MurmurHash3_x64_128)
  // From http://code.google.com/p/smhasher/source/browse/trunk/main.cpp
  HashTestUtils.verifyHashFunction(hf, 128, 0x6384BA69);
}
项目:guava    文件:Murmur3Hash32Test.java   
public void testParanoidHashBytes() {
  HashFn hf =
      new HashFn() {
        @Override
        public byte[] hash(byte[] input, int seed) {
          return murmur3_32(seed).hashBytes(input).asBytes();
        }
      };
  // Murmur3A, MurmurHash3 for x86, 32-bit (MurmurHash3_x86_32)
  // https://github.com/aappleby/smhasher/blob/master/src/main.cpp
  HashTestUtils.verifyHashFunction(hf, 32, 0xB0F57EE3);
}
项目:guava    文件:Murmur3Hash32Test.java   
public void testParanoid() {
  HashFn hf =
      new HashFn() {
        @Override
        public byte[] hash(byte[] input, int seed) {
          Hasher hasher = murmur3_32(seed).newHasher();
          Funnels.byteArrayFunnel().funnel(input, hasher);
          return hasher.hash().asBytes();
        }
      };
  // Murmur3A, MurmurHash3 for x86, 32-bit (MurmurHash3_x86_32)
  // https://github.com/aappleby/smhasher/blob/master/src/main.cpp
  HashTestUtils.verifyHashFunction(hf, 32, 0xB0F57EE3);
}
项目:guava    文件:Murmur3Hash128Test.java   
public void testParanoid() {
  HashFn hf =
      new HashFn() {
        @Override
        public byte[] hash(byte[] input, int seed) {
          Hasher hasher = murmur3_128(seed).newHasher();
          Funnels.byteArrayFunnel().funnel(input, hasher);
          return hasher.hash().asBytes();
        }
      };
  // Murmur3F, MurmurHash3 for x64, 128-bit (MurmurHash3_x64_128)
  // From http://code.google.com/p/smhasher/source/browse/trunk/main.cpp
  HashTestUtils.verifyHashFunction(hf, 128, 0x6384BA69);
}
项目:guava    文件:Murmur3Hash32Test.java   
public void testParanoidHashBytes() {
  HashFn hf =
      new HashFn() {
        @Override
        public byte[] hash(byte[] input, int seed) {
          return murmur3_32(seed).hashBytes(input).asBytes();
        }
      };
  // Murmur3A, MurmurHash3 for x86, 32-bit (MurmurHash3_x86_32)
  // https://github.com/aappleby/smhasher/blob/master/src/main.cpp
  HashTestUtils.verifyHashFunction(hf, 32, 0xB0F57EE3);
}
项目:guava    文件:Murmur3Hash32Test.java   
public void testParanoid() {
  HashFn hf =
      new HashFn() {
        @Override
        public byte[] hash(byte[] input, int seed) {
          Hasher hasher = murmur3_32(seed).newHasher();
          Funnels.byteArrayFunnel().funnel(input, hasher);
          return hasher.hash().asBytes();
        }
      };
  // Murmur3A, MurmurHash3 for x86, 32-bit (MurmurHash3_x86_32)
  // https://github.com/aappleby/smhasher/blob/master/src/main.cpp
  HashTestUtils.verifyHashFunction(hf, 32, 0xB0F57EE3);
}