aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2019-02-18 15:17:30 +0100
committerGitHub <noreply@github.com>2019-02-18 15:17:30 +0100
commitd927cdf579db8ed6807cedaf956134d3fc8a9027 (patch)
treeb429cc707c31040fa7861875f6dff0b85a9753c1
parent27b70ed0bab93aa05dfb62717042ce22c9a027be (diff)
downloadperl-software-in-gnu-guix-d927cdf579db8ed6807cedaf956134d3fc8a9027.tar
perl-software-in-gnu-guix-d927cdf579db8ed6807cedaf956134d3fc8a9027.tar.gz
Revert "impove randomness"
-rw-r--r--plugin/multiplex/index.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin/multiplex/index.js b/plugin/multiplex/index.js
index f11639b..8195f04 100644
--- a/plugin/multiplex/index.js
+++ b/plugin/multiplex/index.js
@@ -44,8 +44,7 @@ app.get("/", function(req, res) {
app.get("/token", function(req,res) {
var ts = new Date().getTime();
- var rand = new Uint32Array(1);
- window.crypto.getRandomValues(rand)
+ var rand = Math.floor(Math.random()*9999999);
var secret = ts.toString() + rand.toString();
res.send({secret: secret, socketId: createHash(secret)});
});
@@ -62,4 +61,4 @@ var brown = '\033[33m',
green = '\033[32m',
reset = '\033[0m';
-console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset );
+console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset ); \ No newline at end of file