> ## Documentation Index
> Fetch the complete documentation index at: https://litprotocol-feat-rusk-sdk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getIpfsId

> Generate CIDv0 hashes with the Lit Client IPFS helper

## Overview

`getIpfsId` is an optional helper exported via `@lit-protocol/lit-client/ipfs`. It produces CIDv0 IPFS identifiers identical to the Lit SDK v7 utility while remaining fully tree-shakeable from the main client bundle.

## Usage

```ts theme={null}
import { getIpfsId } from '@lit-protocol/lit-client/ipfs';

const cid = await getIpfsId('console.log("hello lit")');
// cid === 'Qm...'

const bytes = new TextEncoder().encode('console.log("hello lit")');
const sameCid = await getIpfsId(bytes);
// sameCid === cid
```

## Parameters

| Name  | Type                                                     | Description                                                                                                     |
| ----- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| input | `string \| Uint8Array \| ArrayBuffer \| ArrayBufferView` | Source content to hash. Strings are UTF-8 encoded automatically; buffers and typed views are accepted directly. |

## Returns

```
// A CIDv0 string beginning with Qm
Promise<Qm${string}>
```

## Notes

* The helper delegates to the same hashing routine used in v7 (`typestub-ipfs-only-hash`) and can be imported without pulling the entire Lit Client into your bundle.
* Binary payloads do not need to be stringified first—pass any `Uint8Array`, `ArrayBuffer`, or typed view directly and the helper will normalize it before hashing.
