> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Siwe.generateNonce

:::info
`Siwe.generateNonce` is a re-export of ox's [`Siwe.generateNonce`](https://oxlib.sh/api/Siwe/generateNonce). Refer to the ox documentation for the full reference.
:::

Generates random [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361) nonce.

## Imports

```ts
import { Siwe } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Siwe } from 'viem/utils'

Siwe.generateNonce()
// @log: '65ed4681d4efe0270b923ff5f4b097b1c95974dc33aeebecd5724c42fd86dfd25dc70b27ef836b2aa22e68f19ebcccc1'
```

## Definition

```ts
function generateNonce(): string
```

## Return Type

Random nonce.

`string`
