/// <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(Equals(copy)); }
/// <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); return(Test(compare)); }
/// <summary> /// Given this and another bloom, bitwise-OR all the data to get a bloom filter representing a range of data. /// </summary> public void Or(Bloom bloom) { for (int i = 0; i < data.Length; ++i) { data[i] |= bloom.data[i]; } }
public bool Equals(Bloom obj) { if (object.ReferenceEquals(obj, null)) { return(false); } if (object.ReferenceEquals(this, obj)) { return(true); } return(obj == this); }
public SmartContractPoABlockHeader() : base() { hashStateRoot = 0; receiptRoot = 0; logsBloom = new Bloom(); }