(data)
| 317 | // not allowed to exceed 65536 bytes, and can only |
| 318 | // be an integer-type TypedArray. |
| 319 | function getRandomValues(data) { |
| 320 | if (!isTypedArray(data) || |
| 321 | isFloat16Array(data) || |
| 322 | isFloat32Array(data) || |
| 323 | isFloat64Array(data)) { |
| 324 | // Ordinarily this would be an ERR_INVALID_ARG_TYPE. However, |
| 325 | // the Web Crypto API and web platform tests expect this to |
| 326 | // be a DOMException with type TypeMismatchError. |
| 327 | throw lazyDOMException( |
| 328 | 'The data argument must be an integer-type TypedArray', |
| 329 | 'TypeMismatchError'); |
| 330 | } |
| 331 | if (data.byteLength > 65536) { |
| 332 | const { QuotaExceededError } = internalBinding('messaging'); |
| 333 | throw new QuotaExceededError( |
| 334 | 'The requested length exceeds 65,536 bytes'); |
| 335 | } |
| 336 | randomFillSync(data, 0); |
| 337 | return data; |
| 338 | } |
| 339 | |
| 340 | // Implements an RFC 4122 version 4 random UUID. |
| 341 | // To improve performance, random data is generated in batches |
nothing calls this directly
no test coverage detected
searching dependent graphs…