Examples of HashFn


Examples of com.google.common.hash.HashTestUtils.HashFn

  private static void assertHash(int expected, HashCode actual) {
    assertEquals(HashCode.fromInt(expected), actual);
  }

  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();
      }
View Full Code Here

Examples of com.google.common.hash.HashTestUtils.HashFn

    }
    return HashCode.fromBytes(bb.array());
  }

  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();
      }
View Full Code Here

Examples of com.google.common.hash.HashTestUtils.HashFn

    byte[] hash = murmur3_128(seed).newHasher().putBytes(input).hash().asBytes();
    assertTrue(Arrays.equals(expectedHash, hash));
  }

  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();
      }
View Full Code Here

Examples of com.google.common.hash.HashTestUtils.HashFn

/**
* Tests for Murmur3Hash32.
*/
public class Murmur3Hash32Test extends TestCase {
  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();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.