# AbiItem.getSignatureHash

Computes the signature hash for an [`AbiItem.AbiItem`](/api/AbiItem/types#abiitem).

Useful for computing Event Topic values.

## Imports

:::code-group
```ts [Named]
import { AbiItem } from 'ox'
```

```ts [Entrypoint]
import * as AbiItem from 'ox/AbiItem'
```
:::

## Examples

```ts twoslash
import { AbiItem } from 'ox'

const hash = AbiItem.getSignatureHash(
  'event Transfer(address indexed from, address indexed to, uint256 amount)'
)
// @log: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
```

```ts twoslash
// @noErrors
import { Abi, AbiItem } from 'ox'

const erc20Abi = Abi.from([...])

const hash = AbiItem.getSignatureHash(erc20Abi, 'Transfer')
// @log: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
```

```ts twoslash
import { AbiItem } from 'ox'

const hash = AbiItem.getSignatureHash({
  name: 'Transfer',
  type: 'event',
  inputs: [
    { name: 'from', type: 'address', indexed: true },
    { name: 'to', type: 'address', indexed: true },
    { name: 'amount', type: 'uint256', indexed: false }
  ]
})
// @log: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
```

## Definition

```ts
function getSignatureHash<abi, name>(
  abi: abi | Abi.Abi | readonly unknown[],
  name: name,
): Hex.Hex
```

**Source:** [src/core/AbiItem.ts](https://github.com/wevm/ox/blob/main/src/core/AbiItem.ts#L805)

## Parameters

### abi

* **Type:** `abi | Abi.Abi | readonly unknown[]`

### name

* **Type:** `name`

## Return Type

The [`Hash.keccak256`](/api/Hash/keccak256) hash of the ABI item's signature.

`Hex.Hex`
