diff --git a/www/common/common-util.js b/www/common/common-util.js index debbd8e2d..0d0d4c776 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -131,5 +131,9 @@ define([], function () { return g; }; + Util.createRandomInteger = function () { + return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); + }; + return Util; }); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 20927dc04..5214fcc3b 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -72,6 +72,7 @@ define([ common.bytesToKilobytes = Util.bytesToKilobytes; common.fetch = Util.fetch; common.throttle = Util.throttle; + common.createRandomInteger = Util.createRandomInteger; // import hash utilities for export var createRandomHash = common.createRandomHash = Hash.createRandomHash;