# pieceSizesToLeafCount

> **pieceSizesToLeafCount**(`pieceSizes`): `bigint`

Defined in: [packages/synapse-core/src/utils/pdp-size.ts:61](https://github.com/FilOzone/synapse-sdk/blob/61516150b9c5ae7a7abab1af5db8b22b5d0f5a46/packages/synapse-core/src/utils/pdp-size.ts#L61)

Sum the PDP data-bearing leaves produced by known raw piece sizes.

Leaf rounding is applied independently to each piece, matching PDPVerifier.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `pieceSizes` | readonly `bigint`[] | Raw payload size of every piece, in bytes |

## Returns

`bigint`

Aggregate data-bearing leaf count added by the pieces

## Throws

ValidationError when the piece sizes are invalid