Socket
Socket
Sign inDemoInstall

bufferutil

Package Overview
Dependencies
3
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 3.0.0

18

fallback.js

@@ -10,18 +10,2 @@ /*!

/**
* Merges an array of buffers into a target buffer.
*
* @param {Buffer} target The target buffer
* @param {Buffer[]} buffers The array of buffers to merge
* @public
*/
const merge = (target, buffers) => {
var offset = 0;
for (var i = 0; i < buffers.length; i++) {
const buf = buffers[i];
buf.copy(target, offset);
offset += buf.length;
}
};
/**
* Masks a buffer using the given mask.

@@ -57,2 +41,2 @@ *

module.exports = { merge, mask, unmask };
module.exports = { mask, unmask };

9

package.json
{
"name": "bufferutil",
"version": "2.0.1",
"version": "3.0.0",
"description": "WebSocket buffer utils",

@@ -8,3 +8,3 @@ "main": "index.js",

"install": "prebuild-install || node-gyp rebuild",
"test": "echo \"Only testing builds, tests have to be extraced from ws\" && prebuild-ci"
"test": "mocha && prebuild-ci"
},

@@ -30,5 +30,6 @@ "repository": {

"devDependencies": {
"prebuild": "~6.0.2",
"prebuild-ci": "~2.0.0"
"mocha": "~3.2.0",
"prebuild": "~6.1.0",
"prebuild-ci": "~2.2.0"
}
}

@@ -23,26 +23,4 @@ # bufferutil

The module exports 3 different functions.
The module exports two functions.
### `bufferUtil.merge(target, list)`
Merges an array of buffers into a target buffer.
#### Arguments
- `target` - The target buffer.
- `list` - An array containing the `Buffer` instances to merge.
#### Example
```js
'use strict';
const bufferUtil = require('bufferutil');
const crypto = require('crypto');
const target = Buffer.allocUnsafe(10);
bufferUtil.merge(target, [crypto.randomBytes(5), crypto.randomBytes(5)]);
```
### `bufferUtil.mask(source, mask, output, offset, length)`

@@ -49,0 +27,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc