crypto.getRandomValues(typedArray)
-
typedArray<Buffer> | <TypedArray> -
返回:<Buffer> | <TypedArray>
¥Returns: <Buffer> | <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> 的基于整数的实例,即不接受 Float32Array 和 Float64Array。
¥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.