[API reference](https://evolu.dev/docs/api-reference) › [@evolu/sqlite-wasm](https://evolu.dev/docs/api-reference/sqlite-wasm) › computeSahPoolDigest

```ts
function computeSahPoolDigest(
  corpus: Uint8Array,
  flags: number,
): Uint32Array<ArrayBuffer>;
```

Defined in: [packages/sqlite-wasm/src/SahPool.ts:1324](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/sqlite-wasm/src/SahPool.ts#L1324)

Computes the digest of a header's first [sahPoolHeaderCorpusSize](https://evolu.dev/docs/api-reference/sqlite-wasm/variables/sahPoolHeaderCorpusSize) bytes,
as opfs-sahpool does.

Without [sahPoolDigestV2Flag](https://evolu.dev/docs/api-reference/sqlite-wasm/variables/sahPoolDigestV2Flag) in the flags, the digest is the legacy
`[0, 0]`. Otherwise `h1` starts at `0xdeadbeef` and `h2` at `0x41c6ce57`; for
each byte, `h1 = Math.imul(h1 ^ byte, 2654435761)` and `h2 = Math.imul(h2 ^
byte, 104729)`; the digest is `[h1 >>> 0, h2 >>> 0]`. The result's bytes are
written to the header as they are.