projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve games cleaning (unstarted, lost on time)
[vchess.git]
/
server
/
utils
/
tokenGenerator.js
diff --git
a/server/utils/tokenGenerator.js
b/server/utils/tokenGenerator.js
index
2c21b4e
..
a3c5abc
100644
(file)
--- a/
server/utils/tokenGenerator.js
+++ b/
server/utils/tokenGenerator.js
@@
-1,14
+1,11
@@
-function randString()
-{
+function randString() {
return Math.random().toString(36).substr(2); // remove `0.`
}
return Math.random().toString(36).substr(2); // remove `0.`
}
-module.exports = function(tokenLength)
-{
+module.exports = function(tokenLength) {
let res = "";
// 10 = min length of a rand() string
let res = "";
// 10 = min length of a rand() string
- let nbRands = Math.ceil(tokenLength/10);
- for (let i = 0; i < nbRands; i++)
- res += randString();
+ const nbRands = Math.ceil(tokenLength/10);
+ for (let i = 0; i < nbRands; i++) res += randString();
return res.substr(0, tokenLength);
return res.substr(0, tokenLength);
-}
+}
;