bufferutil
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -11,6 +11,5 @@ 'use strict'; | ||
merge: function(mergedBuffer, buffers) { | ||
var offset = 0; | ||
for (var i = 0, offset = 0, l = buffers.length; i < l; ++i) { | ||
var buf = buffers[i]; | ||
for (var i = 0, l = buffers.length; i < l; ++i) { | ||
var buf = buffers[i]; | ||
buf.copy(mergedBuffer, offset); | ||
@@ -20,8 +19,11 @@ offset += buf.length; | ||
}, | ||
mask: function(source, mask, output, offset, length) { | ||
var maskNum = mask.readUInt32LE(0, true); | ||
var i = 0; | ||
var maskNum = mask.readUInt32LE(0, true) | ||
, i = 0 | ||
, num; | ||
for (; i < length - 3; i += 4) { | ||
var num = maskNum ^ source.readUInt32LE(i, true); | ||
num = maskNum ^ source.readUInt32LE(i, true); | ||
if (num < 0) num = 4294967296 + num; | ||
@@ -37,9 +39,12 @@ output.writeUInt32LE(num, offset + i, true); | ||
}, | ||
unmask: function(data, mask) { | ||
var maskNum = mask.readUInt32LE(0, true); | ||
var length = data.length; | ||
var i = 0; | ||
var maskNum = mask.readUInt32LE(0, true) | ||
, length = data.length | ||
, i = 0 | ||
, num; | ||
for (; i < length - 3; i += 4) { | ||
var num = maskNum ^ data.readUInt32LE(i, true); | ||
num = maskNum ^ data.readUInt32LE(i, true); | ||
if (num < 0) num = 4294967296 + num; | ||
@@ -46,0 +51,0 @@ data.writeUInt32LE(num, i, true); |
{ | ||
"name": "bufferutil", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "WebSocket buffer utils", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo \"Only testing builds, test have to be extraced from `ws`\" && exit 0" | ||
}, | ||
@@ -24,4 +24,4 @@ "repository": { | ||
"bindings": "1.2.x", | ||
"nan": "1.8.x" | ||
"nan": "^2.0.5" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
7371
8
52
0
0
61
+ Addednan@2.22.0(transitive)
- Removednan@1.8.4(transitive)
Updatednan@^2.0.5