# getSize

```ts
function getSize(pieceCid): number;
```

Defined in: [packages/synapse-core/src/piece.ts:201](https://github.com/FilOzone/synapse-sdk/blob/1d6c4b9fe34534bf1087dfe41491b72be0b46858/packages/synapse-core/src/piece.ts#L201)

Extract the raw (unpadded) size from a PieceCIDv2

PieceCIDv2 encodes the original data size in its multihash digest through
the tree height and padding values. This function decodes those values to
calculate the original raw data size.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `pieceCid` | `PieceLink` | PieceCID |

## Returns

`number`

The raw size in bytes

## Throws

If the input is not a valid PieceCIDv2