mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 19:20:41 +02:00
* Code cleanup and eslint since -- remove unused variables, clean up RegExs, so on...
This commit is contained in:
parent
a106050ba3
commit
ac1433e84b
112 changed files with 1375 additions and 1898 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue