[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Protocol](https://evolu.dev/docs/api-reference/common/local-first/Protocol) › encodeDbChange

```ts
function encodeDbChange(buffer: Buffer, message: CrdtMessage): void;
```

Defined in: [packages/common/src/local-first/Protocol.ts:2368](https://github.com/evoluhq/evolu/blob/113517df8a8da4e4eed41363077878e657b22fca/packages/common/src/local-first/Protocol.ts#L2368)

Encodes a [CrdtMessage](https://evolu.dev/docs/api-reference/common/local-first/Storage/interfaces/CrdtMessage) as [encodeAndEncryptDbChange](https://evolu.dev/docs/api-reference/common/local-first/Protocol/functions/encodeAndEncryptDbChange) does before
padding and encryption.

[Evolu.getMutationSize](https://evolu.dev/docs/api-reference/common/local-first/Evolu/interfaces/Evolu#getmutationsize) measures mutations with this encoding, so
[maxMutationSize](https://evolu.dev/docs/api-reference/common/local-first/Evolu/variables/maxMutationSize) limits exactly what is encoded, and every change
within it fits one protocol message.