use of org.apache.commons.collections4.bloomfilter.hasher.function.MD5Cyclic in project commons-collections by apache.
the class HasherBloomFilterTest method constructorTest_NonStatic.
/**
* Tests that the constructor works correctly.
*/
@Test
public void constructorTest_NonStatic() {
final Shape shape = new Shape(new MD5Cyclic(), 3, 72, 17);
final DynamicHasher hasher = new DynamicHasher.Builder(new MD5Cyclic()).with("Hello", StandardCharsets.UTF_8).build();
final HasherBloomFilter filter = createFilter(hasher, shape);
final long[] lb = filter.getBits();
assertEquals(2, lb.length);
assertEquals(0x6203101001888c44L, lb[0]);
assertEquals(0x60L, lb[1]);
}
Aggregations