Skip to content

Commit

Permalink
Merge pull request hakimel#2325 from hakimel/revert-2312-improve_rand…
Browse files Browse the repository at this point in the history
…om_number_generation

Revert "impove randomness"
  • Loading branch information
hakimel authored Feb 18, 2019
2 parents d38bf5d + 9af6943 commit b734bde
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugin/multiplex/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)});
});
Expand All @@ -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 );

0 comments on commit b734bde

Please sign in to comment.