Skip to content

Bls.randomPrivateKey

Generates a random BLS12-381 private key.

Imports

Named
import { Bls } from 'ox'

Examples

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

Definition

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

Source: src/Bls.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>