Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bplist-parser

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

bplist-parser - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

test/int64.bplist

22

bplistParser.js

@@ -6,2 +6,3 @@ 'use strict';

var fs = require('fs');
var bigInt = require("big-integer");
var debug = false;

@@ -142,5 +143,24 @@

function bufferToHexString(buffer) {
var str = '';
var i;
for (i = 0; i < buffer.length; i++) {
if (buffer[i] != 0x00) {
break;
}
}
for (; i < buffer.length; i++) {
var part = '00' + buffer[i].toString(16);
str += part.substr(part.length - 2);
}
return str;
}
function parseInteger() {
var length = Math.pow(2, objInfo);
if (length < exports.maxObjectSize) {
if (length > 4) {
var data = buffer.slice(offset + 1, offset + 1 + length);
var str = bufferToHexString(data);
return bigInt(str, 16);
} if (length < exports.maxObjectSize) {
return readUInt(buffer.slice(offset + 1, offset + 1 + length));

@@ -147,0 +167,0 @@ } else {

5

package.json
{
"name": "bplist-parser",
"version": "0.1.0",
"version": "0.1.1",
"description": "Binary plist parser.",

@@ -22,3 +22,6 @@ "main": "bplistParser.js",

"url": "https://github.com/nearinfinity/node-bplist-parser.git"
},
"dependencies": {
"big-integer": "^1.6.7"
}
}

@@ -140,3 +140,21 @@ 'use strict';

});
},
'int64': function (test) {
var file = path.join(__dirname, "int64.bplist");
var startTime = new Date();
bplist.parseFile(file, function (err, dicts) {
if (err) {
throw err;
}
var endTime = new Date();
console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');
var dict = dicts[0];
test.equal(dict['zero'], '0');
test.equal(dict['int64item'], '12345678901234567890');
test.done();
});
}
};
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