> For the complete documentation index, see [llms.txt](https://docs.wander.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wander.app/api/private-hash.md).

# Private hash

The `privateHash()` function allows you to create deterministic secrets (hashes) from some data.

| Argument  | Type                                                 | Description                |
| --------- | ---------------------------------------------------- | -------------------------- |
| `data`    | `ArrayBuffer`                                        | The data to hash           |
| `options` | [`SignMessageOptions`](/api/sign-message.md#options) | Configuration for the hash |

{% hint style="info" %}
**Note:** This function requires the [`SIGNATURE`](/api/connect.md#permissions) permission.
{% endhint %}

## Example usage

```ts
// connect to the extension
await window.arweaveWallet.connect(["SIGNATURE"]);

// data to be hashed
const data = new TextEncoder().encode("The hash of this msg will be signed.");

// create the hash using the active wallet
const hash = await window.arweaveWallet.privateHash(
    data,
    { hashAlgorithm: "SHA-256" }
);

console.log("Data hash is", hash);
```
