crypto.getRandomValues(typedArray)


生成加密强随机值。给定的 typedArray 填充了随机值,并返回对 typedArray 的引用。

¥Generates cryptographically strong random values. The given typedArray is filled with random values, and a reference to typedArray is returned.

给定的 typedArray 必须是 <TypedArray> 的基于整数的实例,即不接受 Float32ArrayFloat64Array

¥The given typedArray must be an integer-based instance of <TypedArray>, i.e. Float32Array and Float64Array are not accepted.

如果给定的 typedArray 大于 65,536 字节,将抛出错误。

¥An error will be thrown if the given typedArray is larger than 65,536 bytes.