on-internet
← Community

What hash function should I use for a bloom-filter with +128-bit keys?

Stack Overflow ·

https://github.com/joeyrobert/bloomfilter uses Random class for the hash function which is a performance killer. What I'm trying to do is input the class with byte[]s instead of a generic argument(T) and get rid of private int Hash(T item) { return item.GetHashCode(); } I know there is a huge performance benefit but I have no idea how to replace _random.Next(_bitSize) here: #region Public Methods /// <summary> /// Adds an item to the bloom filter. /// </summary> /// <param name="item">Item to be added</param> public void Add(T item) { _random = new Random(Hash(item)); for (int i = 0; i < _numb

Comments

Sign in or sign up to comment and upvote.

No comments yet.