# Bloom

Utility functions for working with Bloom Filters as defined in the [Execution API specification](https://github.com/ethereum/execution-apis/blob/main/src/schemas/block.yaml)

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Bloom.contains`](/api/Bloom/contains) | Checks if an input is matched in the bloom filter. |
| [`Bloom.containsHash`](/api/Bloom/containsHash) | Checks if a precomputed `keccak256` hash is matched in a [`Bloom.Prepared`](/api/Bloom/types#prepared) bloom filter. Use when the caller already has the hash and wants to skip the keccak inside `containsPrepared`. |
| [`Bloom.containsPrepared`](/api/Bloom/containsPrepared) | Checks if an input is matched in a [`Bloom.Prepared`](/api/Bloom/types#prepared) bloom filter. |
| [`Bloom.prepare`](/api/Bloom/prepare) | Prepares a bloom filter for repeated membership checks against the same filter. |
| [`Bloom.validate`](/api/Bloom/validate) | Checks if a string is a valid bloom filter value. |

## Errors

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Bloom.InvalidBloomError`](/api/Bloom/errors#bloominvalidbloomerror) | Thrown when a value is not a valid bloom filter. |

## Types

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Bloom.Prepared`](/api/Bloom/types#bloomprepared) | Prepared bloom filter for use with [`Bloom.containsPrepared`](/api/Bloom/containsPrepared)/[`Bloom.containsHash`](/api/Bloom/containsHash). |
