crypto.randomUUID([options])
-
options
<Object>-
disableEntropyCache
<boolean> 默认情况下,为了提高性能,Node.js 会生成并缓存足够多的随机数据,以生成多达 128 个随机 UUID。要在不使用缓存的情况下生成 UUID,请将disableEntropyCache
设置为true
。默认值:false
。¥
disableEntropyCache
<boolean> By default, to improve performance, Node.js generates and caches enough random data to generate up to 128 random UUIDs. To generate a UUID without using the cache, setdisableEntropyCache
totrue
. Default:false
.
-
-
返回:<string>
¥Returns: <string>
生成一个随机的 RFC 4122 版本 4 UUID。UUID 是使用加密伪随机数生成器生成的。
¥Generates a random RFC 4122 version 4 UUID. The UUID is generated using a cryptographic pseudorandom number generator.