Revert "impove randomness"

This commit is contained in:
Hakim El Hattab 2019-02-18 15:17:30 +01:00 committed by GitHub
parent 27b70ed0ba
commit d927cdf579
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)});
});