* Code cleanup and eslint since -- remove unused variables, clean up RegExs, so on...

This commit is contained in:
Bryan Ashby 2018-01-15 12:22:11 -07:00
parent a106050ba3
commit ac1433e84b
112 changed files with 1375 additions and 1898 deletions

View file

@ -7,7 +7,7 @@ let _ = require('lodash');
module.exports = class FNV1a {
constructor(data) {
this.hash = 0x811c9dc5;
if(!_.isUndefined(data)) {
this.update(data);
}
@ -17,7 +17,7 @@ module.exports = class FNV1a {
if(_.isNumber(data)) {
data = data.toString();
}
if(_.isString(data)) {
data = new Buffer(data);
}
@ -28,8 +28,8 @@ module.exports = class FNV1a {
for(let b of data) {
this.hash = this.hash ^ b;
this.hash +=
(this.hash << 24) + (this.hash << 8) + (this.hash << 7) +
this.hash +=
(this.hash << 24) + (this.hash << 8) + (this.hash << 7) +
(this.hash << 4) + (this.hash << 1);
}
@ -46,5 +46,5 @@ module.exports = class FNV1a {
get value() {
return this.hash & 0xffffffff;
}
}
};