Generate cryptographically secure random bytes. Uses crypto.getRandomValues which is available in all target runtimes.
crypto.getRandomValues
import { randomBytes } from "@aspect/crypto-edge";const iv = randomBytes(12); // 96-bit IV for AES-GCMconst key = randomBytes(32); // 256-bit key Copy
import { randomBytes } from "@aspect/crypto-edge";const iv = randomBytes(12); // 96-bit IV for AES-GCMconst key = randomBytes(32); // 256-bit key
Generate cryptographically secure random bytes. Uses
crypto.getRandomValueswhich is available in all target runtimes.