Example usage for com.google.common.hash Hashing goodFastHash

List of usage examples for com.google.common.hash Hashing goodFastHash

Introduction

In this page you can find the example usage for com.google.common.hash Hashing goodFastHash.

Prototype

public static HashFunction goodFastHash(int minimumBits) 

Source Link

Document

Returns a general-purpose, temporary-use, non-cryptographic hash function.

Usage

From source file:org.apache.phoenix.filter.SkipScanFilter.java

@Override
public int hashCode() {
    HashFunction hf = Hashing.goodFastHash(32);
    Hasher h = hf.newHasher();/*from  w w w.j  a  v a 2  s . com*/
    h.putInt(slots.size());
    for (int i = 0; i < slots.size(); i++) {
        h.putInt(slots.get(i).size());
        for (int j = 0; j < slots.size(); j++) {
            h.putBytes(slots.get(i).get(j).getLowerRange());
            h.putBytes(slots.get(i).get(j).getUpperRange());
        }
    }
    return h.hash().asInt();
}