# pieceSizesToLeafCount

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

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