Revise server code + a few fixes in trnalsations and ComputerGame
[vchess.git] / server / utils / tokenGenerator.js
index 858bc3b..2c21b4e 100644 (file)
@@ -3,11 +3,12 @@ function randString()
   return Math.random().toString(36).substr(2); // remove `0.`
 }
 
-module.exports = function(tlen)
+module.exports = function(tokenLength)
 {
   let res = "";
-  let nbRands = Math.ceil(tlen/10); //10 = min length of a rand() string
+  // 10 = min length of a rand() string
+  let nbRands = Math.ceil(tokenLength/10);
   for (let i = 0; i < nbRands; i++)
     res += randString();
-  return res.substr(0, tlen);
+  return res.substr(0, tokenLength);
 }