Example 1 — Example
Typical usage.
JavaScript
const bytes = new Uint8Array(4);
crypto.getRandomValues(bytes);
console.log(bytes.length);
console.log(typeof crypto.subtle);How It Works
- getRandomValues. Fills with CSPRNG bytes.
- subtle. Crypto operations (async).
