public void addLong(long val) { // puts long in little endian order addHash(Murmur3.hash64(val)); }
/** * ByteBuffer based copy of {@link BloomKFilter#addBytes(byte[], int, int)} that adds a value to the ByteBuffer * in place. */ public static void addBytes(ByteBuffer buffer, byte[] val, int offset, int length) { long hash64 = val == null ? Murmur3.NULL_HASHCODE : Murmur3.hash64(val, offset, length); addHash(buffer, hash64); }
/** * ByteBuffer based copy of {@link BloomKFilter#addLong(long)} that adds a value to the ByteBuffer in place. */ public static void addLong(ByteBuffer buffer, long val) { addHash(buffer, Murmur3.hash64(val)); }
public void addBytes(byte[] val, int offset, int length) { // We use the trick mentioned in "Less Hashing, Same Performance: Building a Better Bloom Filter" // by Kirsch et.al. From abstract 'only two hash functions are necessary to effectively // implement a Bloom filter without any loss in the asymptotic false positive probability' // Lets split up 64-bit hashcode into two 32-bit hash codes and employ the technique mentioned // in the above paper long hash64 = val == null ? Murmur3.NULL_HASHCODE : Murmur3.hash64(val, offset, length); addHash(hash64); }