Skip to content

AesGcm.randomSalt

Generates a random salt of the specified size.

Imports

Named
import { AesGcm } from 'ox'

Examples

import { AesGcm } from 'ox'
 
const salt = AesGcm.randomSalt()
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

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

Source: src/core/AesGcm.ts

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