-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor ES6 syntax changes into your repository (#13)
* minor es6 fixes * node js test yml, add github actions and tests if u want to
- Loading branch information
Showing
3 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|
@@ -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, | ||
|
@@ -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> | ||
|
@@ -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; | ||
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]" | ||
}, | ||
|