Skip to content

createPieceCIDStream

function createPieceCIDStream(): object;

Defined in: src/piece/piece.ts:173

Create a TransformStream that calculates PieceCID while streaming data through it This allows calculating PieceCID without buffering the entire data in memory

object

An object with the TransformStream and a getPieceCID function to retrieve the result

getPieceCID: () =>
| null
| PieceLink;

| null | PieceLink

stream: TransformStream<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;