# `EEVM.Block.Bloom`
[🔗](https://github.com/mw2000/eevm/blob/main/lib/eevm/block/bloom.ex#L1)

Ethereum logs bloom filter — 256-byte (2048-bit) probabilistic filter
summarising the addresses and indexed topics of every log in a receipt or
block. Each item is added via 3 hash probes derived from Keccak-256
(Yellow Paper §4.3.1). The `data` field of a log is not included.

# `log_entry`

```elixir
@type log_entry() :: %{
  address: non_neg_integer(),
  data: binary(),
  topics: [non_neg_integer()]
}
```

# `t`

```elixir
@type t() :: &lt;&lt;_::2048&gt;&gt;
```

# `add`

```elixir
@spec add(t(), binary()) :: t()
```

Add an item (raw bytes) to the bloom filter.

The item should be a binary — 20 bytes for an address, 32 bytes for a topic.

# `contains?`

```elixir
@spec contains?(t(), binary()) :: boolean()
```

Check if a bloom filter might contain an item (false positives possible).

# `empty`

```elixir
@spec empty() :: t()
```

Returns an empty (all-zero) 256-byte bloom filter.

# `from_logs`

```elixir
@spec from_logs([log_entry()]) :: t()
```

Compute the bloom filter for a list of logs.

Each log's address and topics are added. The `data` field is NOT included.

# `merge`

```elixir
@spec merge(t(), t()) :: t()
```

Bitwise OR of two bloom filters.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
