Exemplo n.º 1
0
        public override void Add(T item)
        {
            if (!redisHelper.KeyExists("BloomFilter"))
            {
                redisHelper.StringSetBit("BloomFilter", 0, false);
            }
            int primaryHash   = item.GetHashCode();
            int secondaryHash = getHashSecondary(item);

            for (int i = 0; i < hashFunctionCount; i++)
            {
                int hash = computeHash(primaryHash, secondaryHash, i);
                redisHelper.StringSetBit("BloomFilter", hash, true);
            }
        }