Skip to content

hexToPieceCID

function hexToPieceCID(pieceCidHex): PieceLink;

Defined in: packages/synapse-core/src/piece.ts:371

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

ParameterTypeDescription
pieceCidHexstringThe hex representation of the PieceCID

PieceLink

The PieceCID object