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

geoip-lite

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geoip-lite - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

47

lib/converter.js

@@ -11,2 +11,41 @@ var fs = require('fs');

// First we have to define writeUInt32 correctly based on the node version in use
// Our fault for using unstable APIs
var writeUInt32;
if(process.version.match(/^v0\.4\./)) {
writeUInt32 = function(b, value, offset, bigEndian) {
if(bigEndian) {
b[offset+0] = (value >> 24) & 0xff;
b[offset+1] = (value >> 16) & 0xff;
b[offset+2] = (value >> 8) & 0xff;
b[offset+3] = (value >>> 0) & 0xff;
}
else {
b[offset+3] = (value >> 24) & 0xff;
b[offset+2] = (value >> 16) & 0xff;
b[offset+1] = (value >> 8) & 0xff;
b[offset+0] = (value >>> 0) & 0xff;
}
return true;
};
}
else if(process.version == 'v0.5.3') {
writeUInt32 = function(b, value, offset, bigEndian) {
return b.writeUInt32(value, offset, bigEndian?"big":"little");
};
}
else if(process.version == 'v0.5.4') {
writeUInt32 = function(b, value, offset, bigEndian) {
return b.writeUInt32(value, offset, bigEndian);
};
}
else if((new Buffer(0).writeUInt32BE)) {
writeUInt32 = function(b, value, offset, bigEndian) {
if(bigEndian)
return b.writeUInt32BE(value, offset);
else
return b.writeUInt32LE(value, offset);
};
}
var lastline = "";

@@ -31,5 +70,5 @@

for(i=0; i<sip.length; i++)
b.writeUInt32(sip[i], i*4, true);
writeUInt32(b, sip[i], i*4, true);
for(i=0; i<eip.length; i++)
b.writeUInt32(eip[i], 16+i*4, true);
writeUInt32(b, eip[i], 16+i*4, true);
}

@@ -45,4 +84,4 @@ else {

b.fill(0);
b.writeUInt32(sip, 0, true);
b.writeUInt32(eip, 4, true);
writeUInt32(b, sip, 0, true);
writeUInt32(b, eip, 4, true);
}

@@ -49,0 +88,0 @@

2

package.json
{
"name" : "geoip-lite",
"version" : "1.0.3",
"version" : "1.0.4",
"description" : "A light weight native JavaScript implementation of GeoIP API from MaxMind",

@@ -5,0 +5,0 @@ "keywords" : ["geo", "geoip", "ip", "ipv4", "ipv6", "geolookup", "maxmind", "geolite"],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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