Merge pull request #2325 from hakimel/revert-2312-improve_random_number_generation

Revert "impove randomness"
edit
Hakim El Hattab 2019-02-18 15:18:59 +01:00 committed by GitHub
commit 1efb8260af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -44,8 +44,7 @@ app.get("/", function(req, res) {
app.get("/token", function(req,res) { app.get("/token", function(req,res) {
var ts = new Date().getTime(); var ts = new Date().getTime();
var rand = new Uint32Array(1); var rand = Math.floor(Math.random()*9999999);
window.crypto.getRandomValues(rand)
var secret = ts.toString() + rand.toString(); var secret = ts.toString() + rand.toString();
res.send({secret: secret, socketId: createHash(secret)}); res.send({secret: secret, socketId: createHash(secret)});
}); });