Generate cryptographically secure random bytes. Uses crypto.getRandomValues which is available in all target runtimes.
crypto.getRandomValues
If the runtime has no crypto.getRandomValues. There is deliberately no non-cryptographic fallback.
import { randomBytes } from "@sebastienrousseau/crypto-edge";const iv = randomBytes(12); // 96-bit IV for AES-GCMconst key = randomBytes(32); // 256-bit key Copy
import { randomBytes } from "@sebastienrousseau/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.