Crypto Edge
    Preparing search index...

    Function randomBytes

    • Generate cryptographically secure random bytes. Uses crypto.getRandomValues which is available in all target runtimes.

      Parameters

      • length: number

      Returns Uint8Array

      import { randomBytes } from "@aspect/crypto-edge";

      const iv = randomBytes(12); // 96-bit IV for AES-GCM
      const key = randomBytes(32); // 256-bit key