# Bloom.prepare

Prepares a bloom filter for repeated membership checks against the same filter.

Pairs with [`Bloom.containsPrepared`](/api/Bloom/containsPrepared) (or [`Bloom.containsHash`](/api/Bloom/containsHash)) to avoid the per-call hex-to-bytes conversion that [`Bloom.contains`](/api/Bloom/contains) pays.

## Imports

:::code-group
```ts [Named]
import { Bloom } from 'ox'
```

```ts [Entrypoint]
import * as Bloom from 'ox/Bloom'
```
:::

## Examples

```ts twoslash
import { Bloom } from 'ox'

const prepared = Bloom.prepare(
  '0x00000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002020000000000000000000000000000000000000000000008000000001000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
)
Bloom.containsPrepared(
  prepared,
  '0xef2d6d194084c2de36e0dabfce45d046b37d1106'
)
// @log: true
```

## Definition

```ts
function prepare(
  bloom: Hex.Hex,
): Prepared
```

**Source:** [src/core/Bloom.ts](https://github.com/wevm/ox/blob/main/src/core/Bloom.ts#L189)

## Parameters

### bloom

* **Type:** `Hex.Hex`

Bloom filter value.

## Return Type

A prepared bloom filter.

[`Prepared`](/api/Bloom/types#bloomprepared)
