From fd83ae3e61d92f614361c52973c1b0464821eb96 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 24 May 2017 11:34:40 +0200 Subject: [PATCH] implement createRandomInteger --- www/common/common-util.js | 4 ++++ www/common/cryptpad-common.js | 1 + 2 files changed, 5 insertions(+) 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;