Added configuration options to the API to support supplied hashing
functions, configurable filter sizes, bucket sizes and fingerprint
sizes. Additionally there is the option to specify maximum number of
kicks displacing fingerprints from their buckets. They are to be
provided to cfilter.New(opts ...options)
and are as follows:
- cfilter.Size(uint) sets the number of buckets in the filter
- cfilter.BucketSize(uint8) sets the size of each bucket
- cfilter.FingerprintSize(uint8) sets the size of the fingerprint
- cfilter.MaximumKicks(uint) sets the maximum number of bucket kicks
- cfilter.HashFn(hash.Hash) sets the fingerprinting hashing function
NOTE: this commit introduces a change to the API, in order to retrieve
the number or items currently in the filter instead of cf.Size()
you
would now use cf.Count()
.