# rawSizeToLeafCount

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

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