public final class ByteArrayFilter extends java.lang.Object
One application of this filters out duplicate UDP packets that are received. UDP does not guarantee delivery of packets. So, applications commonly send out the same UDP message multiple times. This class is used as a filter that tries to filter out duplicate packets. It is not perfect. A collision in the hash function could lead to a response "packet seen before" when it has not been seen before. The class has a limited amount of storage by design (keep resource usage bounded), so this limitation could lead to an erroneous "packet never seen before" response. So, there is an error condition affecting true and a different error condition affecting false.
yyhash.YYHash() is a hash function that is selected randomly during construction of the object of type yyhash. This makes it hard for an adversary to predict what a packet will hash to. The security ramifications of this are covered in more detail in code comments in yyhash.java.
|Constructor and Description|
public ByteArrayFilter(int maxbarrays, ByteArray randbytes16) throws FeralcoreException
public boolean seenbytearray(ByteArray barr) throws FeralcoreException, java.security.NoSuchAlgorithmException
public int size()