# rawSizeToLeafCount

> **rawSizeToLeafCount**(`rawSize`): `bigint`

Defined in: [packages/synapse-core/src/utils/pdp-size.ts:31](https://github.com/FilOzone/synapse-sdk/blob/0c729dad461472f017e4d84f8e6ac16e6afbe7c0/packages/synapse-core/src/utils/pdp-size.ts#L31)

Calculate the PDP data-bearing leaf count for a known raw piece size.

PieceCID construction expands 127 raw bytes into four 32-byte leaves. PDP
excludes leaves that contain only zero padding, so a partially occupied leaf
is counted in full. The result depends only on the raw size, not the piece
contents.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `rawSize` | `bigint` | Exact raw payload size for one piece, in bytes |

## Returns

`bigint`

Number of data-bearing 32-byte leaves PDP records for the piece