Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit 2f9d436

Browse files
Add the disableEntropyCache option for UUID…
…because without it, the Node docs say that only the first 128 UUIDs will be sufficiently random.
1 parent 145726c commit 2f9d436

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/variable.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ const RESOLVERS = {
164164
// $UUID will be easy to implement once Pulsar runs a newer version of Node, so
165165
// there's no reason not to be proactive and sniff for the function we need.
166166
if (('randomUUID' in crypto) && (typeof crypto.randomUUID === 'function')) {
167-
RESOLVERS['UUID'] = () => { return crypto.randomUUID() }
167+
RESOLVERS['UUID'] = () => {
168+
return crypto.randomUUID({disableEntropyCache: true})
169+
}
168170
}
169171

170172

0 commit comments

Comments
 (0)