Skip to content

X25519.randomPrivateKey

Generates a random X25519 private key.

Imports

Named
import { X25519 } from 'ox'

Examples

import { X25519 } from 'ox'
 
const privateKey = X25519.randomPrivateKey()

Definition

function randomPrivateKey<as>(
  options?: randomPrivateKey.Options<as>,
): randomPrivateKey.ReturnType<as>

Source: src/core/X25519.ts

Parameters

options

  • Type: randomPrivateKey.Options<as>
  • Optional

The options to generate the private key.

options.as

  • Type: "Bytes" | "Hex" | as
  • Optional

Format of the returned private key.

Return Type

The generated private key.

randomPrivateKey.ReturnType<as>