Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

std/node/crypto.ts>randomBytes

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function randomBytes
Re-export
import { randomBytes } from "https://deno.land/std@0.145.0/node/crypto.ts";

Parameters

size: number

Buffer length, must be equal or greater than zero

Returns

Buffer

Parameters

size: number
optional
cb: (err: Error | null, buf?: Buffer) => void

Parameters

size: number
optional
cb: (err: Error | null, buf?: Buffer) => void

Returns

Buffer | void