Skip to content

Hex.random

Generates a random Hex.Hex value of the specified length.

Imports

Named
import { Hex } from 'ox'

Examples

import { Hex } from 'ox'
 
const hex = Hex.random(32)
'0x...'

Definition

function random(
  length: number,
): Hex

Source: src/core/Hex.ts

Parameters

length

  • Type: number

Return Type

Random Hex.Hex value.

Hex