JS Built-ins
cryptointermediate

crypto β€” values are numbers

πŸ“– Usage Example
const key = crypto.getRandomValues(new Uint8Array(32))
// 256 random bits for cryptographic use

Generate 32 random bytes (256 bits) as a cryptographic key or seed.

crypto.getRandomValues() β€” element types

Each element in the array filled by crypto.getRandomValues() is a number.

Challenge: Verify that the first element of a random array is a number.

πŸ’‘ Hints (1)
  • β€’ Typed array elements are automatically numbers