bplist-parser
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -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 { |
{ | ||
"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(); | ||
}); | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48245
14
455
1
8
+ Addedbig-integer@^1.6.7
+ Addedbig-integer@1.6.52(transitive)