# AesGcm.randomSalt

Generates a random salt of the specified size.

## Imports

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

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

## Examples

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

const salt = AesGcm.randomSalt()
// @log: Uint8Array [123, 79, 183, 167, 163, 136, 136, 16, 168, 126, 13, 165, 170, 166, 136, 136, 16, 168, 126, 13, 165, 170, 166, 136, 136, 16, 168, 126, 13, 165, 170, 166]
```

## Definition

```ts
function randomSalt(
  size?: number,
): Bytes.Bytes
```

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

## Parameters

### size

* **Type:** `number`
* **Optional**

The size of the salt to generate. Defaults to `32`.

## Return Type

A random salt of the specified size.

`Bytes.Bytes`
