Skip to content

Commit

Permalink
Minor ES6 syntax changes into your repository (#13)
Browse files Browse the repository at this point in the history
* minor es6 fixes

* node js test yml, add github actions and tests if u want to
  • Loading branch information
Dnkfff authored May 20, 2022
1 parent 7a15d5e commit fbbd9bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Empty file added .github/node.js.yml
Empty file.
12 changes: 6 additions & 6 deletions murmurhash.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function(){
var _global = this;
const _global = this;

const createBuffer = (val) => new TextEncoder().encode(val)

Expand All @@ -17,7 +17,7 @@
*/
function MurmurHashV2(str, seed) {
if (typeof str === 'string') str = createBuffer(str);
var
let
l = str.length,
h = seed ^ l,
i = 0,
Expand Down Expand Up @@ -54,7 +54,7 @@
return h >>> 0;
};

/**
/*
* JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)
*
* @author <a href="mailto:[email protected]">Gary Court</a>
Expand All @@ -69,7 +69,7 @@
function MurmurHashV3(key, seed) {
if (typeof key === 'string') key = createBuffer(key);

var remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i;
let remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i;

remainder = key.length & 3; // key.length % 4
bytes = key.length - remainder;
Expand Down Expand Up @@ -120,14 +120,14 @@
return h1 >>> 0;
}

var murmur = MurmurHashV3;
const murmur = MurmurHashV3;
murmur.v2 = MurmurHashV2;
murmur.v3 = MurmurHashV3;

if (typeof(module) != 'undefined') {
module.exports = murmur;
} else {
var _previousRoot = _global.murmur;
const _previousRoot = _global.murmur;
murmur.noConflict = function() {
_global.murmur = _previousRoot;
return murmur;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name" : "murmurhash",
"version" : "1.0.0",
"description" : "A Node.js module for the optimized JavaScript implementation of the MurmurHash algorithms.",
"author": {
"authors": {
"Gary Court": "[email protected]",
"Derek Perez": "[email protected]"
},
Expand Down

0 comments on commit fbbd9bf

Please sign in to comment.