Пример #1
0
        /// <summary>
        /// Determine whether a second bloom is possibly contained within the filter.
        /// </summary>
        /// <param name="bloom">The second bloom to test.</param>
        /// <returns>Whether this data could be contained within the filter.</returns>
        public bool Test(Bloom bloom)
        {
            var copy = new Bloom(bloom.ToBytes());

            copy.Or(this);
            return(this.Equals(copy));
        }
Пример #2
0
        /// <summary>
        /// Determine whether some input is possibly contained within the filter.
        /// </summary>
        /// <param name="test">The byte array to test.</param>
        /// <returns>Whether this data could be contained within the filter.</returns>
        public bool Test(byte[] test)
        {
            var compare = new Bloom();

            compare.Add(test);
            compare.Or(this);
            return(this.Equals(compare));
        }