# pieceSizesToLeafCount

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

Defined in: [packages/synapse-core/src/utils/pdp-size.ts:61](https://github.com/FilOzone/synapse-sdk/blob/be109459b3ce23e76e3fc606d809ae47209fe3d3/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