+6
-2
@@ -117,4 +117,5 @@ var bl = require('bl') | ||
| , length | ||
| , result | ||
| , result = 0 | ||
| , type | ||
| , bytePos | ||
@@ -146,3 +147,6 @@ if (!hasMinBufferSize(first, bufLength)) { | ||
| // 8-bytes BE unsigned int | ||
| result = buf.readUInt32BE(offset + 5) * 0xffffffff + buf.readUInt32BE(offset + 1) | ||
| // Read long byte by byte, big-endian | ||
| for (bytePos = 7; bytePos >= 0; bytePos--) { | ||
| result += (buf.readUInt8(offset + bytePos + 1) * Math.pow(2 , (8 *(7-bytePos)))); | ||
| } | ||
| return buildDecodeResult(result, 9) | ||
@@ -149,0 +153,0 @@ case 0xd0: |
+5
-3
@@ -222,5 +222,7 @@ | ||
| function write64BitUint(buf, obj) { | ||
| var big = Math.floor(obj / 0xffffffff) | ||
| buf.writeUInt32BE(big, 5) | ||
| buf.writeUInt32BE(obj - big * 0xffffffff, 1) | ||
| // Write long byte by byte, in big-endian order | ||
| for (var currByte = 7; currByte >= 0; currByte--) { | ||
| buf[currByte + 1] = (obj & 0xff); | ||
| obj = obj / 256; | ||
| } | ||
| } | ||
@@ -227,0 +229,0 @@ |
+1
-1
| { | ||
| "name": "msgpack5", | ||
| "version": "2.1.0", | ||
| "version": "2.2.0", | ||
| "description": "A msgpack v5 implementation for node.js and the browser, with extension points", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,2 @@ | ||
| , allNum = [] | ||
| , base = 0xffffffff | ||
@@ -16,3 +15,2 @@ allNum.push(0xffffffff) | ||
| allNum.forEach(function(num) { | ||
@@ -23,3 +21,7 @@ t.test('encoding ' + num, function(t) { | ||
| t.equal(buf[0], 0xcf, 'must have the proper header') | ||
| t.equal(buf.readUInt32BE(5) * base + buf.readUInt32BE(1), num, 'must decode correctly'); | ||
| var result = 0; | ||
| for (var k = 7; k >= 0; k--) { | ||
| result += (buf.readUInt8(k + 1) * Math.pow(2 , (8 *(7-k)))); | ||
| } | ||
| t.equal(result, num, 'must decode correctly'); | ||
| t.end() | ||
@@ -26,0 +28,0 @@ }) |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
409388
0.06%8183
0.11%