# calculateFromIterable

```ts
function calculateFromIterable(data): Promise<PieceLink>;
```

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

Calculate PieceCID from an async iterable of Uint8Array chunks.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `data` | `AsyncIterable`\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\> | AsyncIterable yielding Uint8Array chunks |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`PieceLink`\>

Calculated PieceCID

## Example

```ts
const pieceCid = await calculateFromIterable(asyncIterableData)
```