# hexToPieceCID

> **hexToPieceCID**(`pieceCidHex`): `PieceLink`

Defined in: [packages/synapse-core/src/piece/piece.ts:232](https://github.com/FilOzone/synapse-sdk/blob/7fdc04df4e3c52366a9f0cd55da4c05e20b2ed82/packages/synapse-core/src/piece/piece.ts#L232)

Convert a hex representation of a PieceCID to a PieceCID object

The contract stores the full PieceCID multihash digest (including height and padding)
The data comes as a hex string, we need to decode it as bytes then as a CID to get the PieceCID object

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `pieceCidHex` | `string` | The hex representation of the PieceCID |

## Returns

`PieceLink`

The PieceCID object