# chunkLayout

> **chunkLayout**(`ciphertextSize`, `chunkSize`): [`ChunkLayout`](/reference/filoz/filecoin-encryption-envelope/interfaces/chunklayout/)

Defined in: [packages/filecoin-encryption-envelope/src/chunk-layout.ts:27](https://github.com/FilOzone/synapse-sdk/blob/4fe24ea1c76c9b1fa1489b7cdbb1cc279bd2576a/packages/filecoin-encryption-envelope/src/chunk-layout.ts#L27)

Derive the chunk layout of a stored blob from its ciphertext size and
chunk size — never the reverse. A declared `chunk_count` header must be
checked against `chunkLayout(...).chunkCount`, not the other way around,
or a truncated object would go undetected (docs/tech-spec.md, "Three
rules make the check correct").

## Parameters

| Parameter | Type |
| ------ | ------ |
| `ciphertextSize` | `number` |
| `chunkSize` | `number` |

## Returns

[`ChunkLayout`](/reference/filoz/filecoin-encryption-envelope/interfaces/chunklayout/)