New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

saulx-murmur

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saulx-murmur - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

builds/darwin_x64_83.node

30

incremental.js

@@ -1,21 +0,15 @@

/* expose pure incremental api */
"use strict";
module.exports = (() => {
try {
const murmur = require("./builds/incremental/" +
process.platform +
"_" +
process.arch +
"_" +
process.versions.modules +
".node");
const getBuild = () => {
const murmur = require("./builds/incremental/" +
process.platform +
"_" +
process.arch +
"_" +
process.versions.modules +
".node");
return murmur;
} catch (e) {
throw new Error(
"This version of murmur is not compatible with your Node.js build:\n\n" +
e.toString()
);
}
})();
return murmur;
};
module.exports = getBuild();

45

index.js
"use strict";
module.exports = (() => {
try {
const murmur = require("./builds/" +
process.platform +
"_" +
process.arch +
"_" +
process.versions.modules +
".node");
return murmur;
} catch (e) {
const fs = require("fs");
const pathResolve = require("path").resolve;
const { execSync } = require("child_process");
let murmur;
console.log(
"Cannot use prebuilt Murmur version. Falling back to murmurhash-native."
);
// check for murmurhash-native without adding it to the require cache
module.paths.forEach((path) => {
if (fs.existsSync(pathResolve(path, "murmurhash-native")) === true) {
murmur = require("murmurhash-native");
}
});
if (!murmur) {
console.log("Installing murmurhash-native");
execSync("npm install murmurhash-native");
murmur = require("murmurhash-native");
}
return murmur;
}
})();
const getBuild = () => {
const murmur = require("./builds/" +
process.platform +
"_" +
process.arch +
"_" +
process.versions.modules +
".node");
return murmur;
};
module.exports = getBuild();

@@ -6,6 +6,6 @@ /* from nodejs lib/internal/streams/lazy_transform.js */

// for the stream, one conventional and one non-conventional.
"use strict";
'use strict';
var stream = require("stream");
var util = require("util");
var stream = require('stream');
var util = require('util');

@@ -19,7 +19,7 @@ module.exports = LazyTransform;

["_readableState", "_writableState", "_transformState"].forEach(function(
prop,
i,
props
) {
[
'_readableState',
'_writableState',
'_transformState'
].forEach(function(prop, i, props) {
Object.defineProperty(LazyTransform.prototype, prop, {

@@ -29,3 +29,3 @@ get: function() {

this._writableState.decodeStrings = false;
this._writableState.defaultEncoding = "binary";
this._writableState.defaultEncoding = 'binary';
return this[prop];

@@ -45,1 +45,2 @@ },

});
{
"name": "saulx-murmur",
"description": "prebuild murmur for node modules v72 and x64 architecture",
"version": "0.2.3",
"description": "prebuild murmur native",
"version": "0.3.0",
"main": "./index.js",
"dependencies": {
"nan": "^2.14.1"
},
"scripts": {

@@ -7,0 +10,0 @@ "test": "node test/index.js"

@@ -7,8 +7,8 @@ "use strict";

exports.getHashes = function() {
exports.getHashes = function () {
return Object.keys(binding)
.filter(function(name) {
.filter(function (name) {
return "function" === typeof binding[name];
})
.map(function(name) {
.map(function (name) {
return name.toLowerCase();

@@ -18,3 +18,3 @@ });

Object.keys(binding).forEach(function(name) {
Object.keys(binding).forEach(function (name) {
if (binding.hasOwnProperty(name) && "function" === typeof binding[name]) {

@@ -84,3 +84,3 @@ algorithms[name.toLowerCase()] = binding[name];

MurmurHash.prototype._transform = function(chunk, encoding, callback) {
MurmurHash.prototype._transform = function (chunk, encoding, callback) {
if (chunk.length < 8192) {

@@ -95,3 +95,3 @@ // this constant was chosen experimentally

MurmurHash.prototype._flush = function(callback) {
MurmurHash.prototype._flush = function (callback) {
this.push(this._handle.digest());

@@ -101,3 +101,3 @@ callback();

MurmurHash.prototype.update = function() {
MurmurHash.prototype.update = function () {
var handle = this._handle;

@@ -107,3 +107,3 @@ return handle.update.apply(handle, arguments) && this;

MurmurHash.prototype.digest = function() {
MurmurHash.prototype.digest = function () {
var handle = this._handle;

@@ -113,7 +113,7 @@ return handle.digest.apply(handle, arguments);

MurmurHash.prototype.serialize = function(type, offset) {
MurmurHash.prototype.serialize = function (type, offset) {
return this._handle.serialize(type, offset);
};
MurmurHash.prototype.copy = function(target) {
MurmurHash.prototype.copy = function (target) {
this._handle.copy(target && target._handle);

@@ -123,7 +123,7 @@ return target;

MurmurHash.prototype.toJSON = function() {
MurmurHash.prototype.toJSON = function () {
var handle = this._handle;
return {
type: handle.constructor.name,
seed: handle.toJSON()
seed: handle.toJSON(),
};

@@ -133,30 +133,30 @@ };

Object.defineProperty(MurmurHash.prototype, "isBusy", {
get: function() {
get: function () {
return this._handle.isBusy;
},
enumerable: false,
configurable: false
configurable: false,
});
Object.defineProperty(MurmurHash.prototype, "total", {
get: function() {
get: function () {
return this._handle.total;
},
enumerable: true,
configurable: true
configurable: true,
});
Object.defineProperty(MurmurHash.prototype, "endianness", {
get: function() {
get: function () {
return this._handle.endianness;
},
set: function(value) {
set: function (value) {
this._handle.endianness = value;
},
enumerable: true,
configurable: false
configurable: false,
});
Object.defineProperty(MurmurHash.prototype, "SERIAL_BYTE_LENGTH", {
get: function() {
get: function () {
Object.defineProperty(this, "SERIAL_BYTE_LENGTH", {

@@ -166,3 +166,3 @@ enumerable: true,

configurable: true,
value: this._handle.SERIAL_BYTE_LENGTH
value: this._handle.SERIAL_BYTE_LENGTH,
});

@@ -172,3 +172,3 @@ return this.SERIAL_BYTE_LENGTH;

enumerable: true,
configurable: true
configurable: true,
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc