From 197eff93e893b5fcaac026bec2cde3c38f5b0196 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 14 Nov 2022 09:59:26 +0100 Subject: [PATCH] :paperclip: Fix nodejs compatibility issue on uuid_impl --- common/src/app/common/uuid_impl.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/uuid_impl.js b/common/src/app/common/uuid_impl.js index 5c184f808c..fd257f6ab9 100644 --- a/common/src/app/common/uuid_impl.js +++ b/common/src/app/common/uuid_impl.js @@ -24,8 +24,10 @@ goog.scope(function() { }; } else if (typeof require === "function") { const crypto = require("crypto"); + const randomBytes = crypto["randomBytes"]; + return (buf) => { - const bytes = crypto.randomBytes(buf.length); + const bytes = randomBytes(buf.length); buf.set(bytes) return buf; };