The `crypto.subtle` and `crypto.getRandomValues()` APIs provide secure, hardware-accelerated cryptographic primitives natively in browsers and Node.
js
const bytes = new Uint8Array(32);
crypto.getRandomValues(bytes);
const hash = await crypto.subtle.digest("SHA-256", bytes);