Cryptographically random data

suggest change
// Create an array with a fixed size and type.
const array = new Uint8Array(5);

// Generate cryptographically random values
crypto.getRandomValues(array);

// Print the array to the console
console.log(array);

crypto.getRandomValues(array) fills an integer typed array. Float arrays throw TypeError. Each entry is chosen from the ranges below, both ends inclusive. The buffer must be at most 65,536 bytes.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents