# pieceSizesToLeafCount

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

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