1
0
Fork 0
mirror of https://github.com/SunRed/haste-server.git synced 2024-11-27 11:20:18 +01:00

A few style nit-picks

This commit is contained in:
John Crepezzi 2017-06-26 12:10:57 -04:00 committed by GitHub
parent d66bc9a6c4
commit 4599203bdf

View file

@ -1,4 +1,4 @@
var fs = require('fs') var fs = require('fs');
var DictionaryGenerator = function(options) { var DictionaryGenerator = function(options) {
//Options //Options
@ -9,7 +9,7 @@ var DictionaryGenerator = function(options) {
//Load dictionary //Load dictionary
fs.readFile(options.path, 'utf8', (err,data) => { fs.readFile(options.path, 'utf8', (err,data) => {
if(err) throw err; if (err) throw err;
this.dictionary = data.split(/[\n\r]+/); this.dictionary = data.split(/[\n\r]+/);
}); });
}; };
@ -18,7 +18,7 @@ var DictionaryGenerator = function(options) {
DictionaryGenerator.prototype.createKey = function(keyLength) { DictionaryGenerator.prototype.createKey = function(keyLength) {
var text = ''; var text = '';
for(var i = 0; i < keyLength; i++) for(var i = 0; i < keyLength; i++)
text += this.dictionary[Math.floor(Math.random()*this.dictionary.length)]; text += this.dictionary[Math.floor(Math.random() * this.dictionary.length)];
return text; return text;
}; };