{"name":"bufferutil","version":"4.0.1","description":"WebSocket buffer utils","main":"index.js","scripts":{"install":"node-gyp-build","prebuild":"prebuildify --napi","test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/websockets/bufferutil.git"},"keywords":["bufferutil"],"author":{"name":"Einar Otto Stangvik","email":"einaros@gmail.com","url":"http://2x.io"},"license":"MIT","bugs":{"url":"https://github.com/websockets/bufferutil/issues"},"homepage":"https://github.com/websockets/bufferutil","dependencies":{"node-gyp-build":"~3.7.0"},"devDependencies":{"mocha":"~5.2.0","prebuildify":"~2.10.0"},"gitHead":"e367139397179f7f132900025e9b461e714a35bc","_id":"bufferutil@4.0.1","_npmVersion":"6.4.1","_nodeVersion":"11.5.0","_npmUser":{"name":"lpinca","email":"luigipinca@gmail.com"},"dist":{"integrity":"sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==","shasum":"3a177e8e5819a1243fe16b63a199951a7ad8d4a7","tarball":"http://registry-npm.ywwl.com/bufferutil/download/bufferutil-4.0.1.tgz","fileCount":15,"unpackedSize":524909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcH0JYCRA9TVsSAnZWagAAkpMQAJ7WLi58+TZTG15Ngddd\nLhTJEUQxSLW15jhGHzw1SZSbfa8oKpcHRRBj65Idfbp9sNl7yG5Tnwam2zj4\nyH2LPLsINuQ+DO6JxLoRahy/xsnzLXtJTUeY3qXu5avaDMLd+biDyiCEghgF\nFh9zvlj+fje7/3zUsiIIuvOBRtciU34rXYZKXQ8PHBEn6vh6IAz6OGxZ6Xuk\niqu+8SdDjg5PG6/Wdv6VS0whJj3UySR9EOgfBnuYxbybUkNDmFuCYrYSRN5i\nFTXSGSCUj1zZwcUuLfHG4M0EAXN4N/HDEbdLQlapIn5YNQLvwPd03Whfqaiw\n+tSZbc9x5pnbr2OpYD4It91yIRUQIE/dxv2D5rte6RQ96ryJUha6IpK+oHBr\ndA8sibg5Xi3J3jv4llpy7y1Od/PNM0u0nyr5ccNRKKx+kPRXyJHQoAawPQro\nxi5JEVxlkPUYFzFiKCFsIbNGVsqndagvFTyA/FfQdYX5MBykKc04LZQV09Ei\nbw4pFGL0r0SPD+ThcAk8gztyEtw1ZwpBe8Kxyu2uhmZiMWig7+Zvs85rKfNh\nevM2WDH1i4BzjnsH1Db5BaPGjLpFj5VxnPMe5fawLDAftkrx3DcaoQDM6yik\nN+9N9ShUgdG/sgvur+MbKB4rGeg9LEe3M6oxxHsZbxilrLqU7ilhBZZn4+hm\nM24q\r\n=Rp//\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE5J9cTzSm6LQjsfjH0sji4/2KU/Ww5Xwc8CHUrW3bGWAiEAp/Sjk3HiB0SglkgRlhQdpOOkIxWsOAEJGtbb50tmDTQ="}],"size":261252,"noattachment":false,"key":"/bufferutil/-/bufferutil-4.0.1.tgz"},"maintainers":[{"email":"npm@3rd-Eden.com","name":"3rdeden"},{"email":"einaros@gmail.com","name":"einaros"},{"email":"luigipinca@gmail.com","name":"lpinca"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bufferutil_4.0.1_1545552472247_0.067683796300124"},"_hasShrinkwrap":false,"readme":"# bufferutil\n\n[![Version npm](https://img.shields.io/npm/v/bufferutil.svg?logo=npm)](https://www.npmjs.com/package/bufferutil)\n[![Linux/macOS/Windows Build](https://img.shields.io/github/actions/workflow/status/websockets/bufferutil/ci.yml?branch=master&label=build&logo=github)](https://github.com/websockets/bufferutil/actions?query=workflow%3ACI+branch%3Amaster)\n\n`bufferutil` is what makes `ws` fast. It provides some utilities to efficiently\nperform some operations such as masking and unmasking the data payload of\nWebSocket frames.\n\n## Installation\n\n```\nnpm install bufferutil --save-optional\n```\n\nThe `--save-optional` flag tells npm to save the package in your package.json\nunder the\n[`optionalDependencies`](https://docs.npmjs.com/files/package.json#optionaldependencies)\nkey.\n\n## API\n\nThe module exports two functions.\n\n### `bufferUtil.mask(source, mask, output, offset, length)`\n\nMasks a buffer using the given masking-key as specified by the WebSocket\nprotocol.\n\n#### Arguments\n\n- `source` - The buffer to mask.\n- `mask` - A buffer representing the masking-key.\n- `output` - The buffer where to store the result.\n- `offset` - The offset at which to start writing.\n- `length` - The number of bytes to mask.\n\n#### Example\n\n```js\n'use strict';\n\nconst bufferUtil = require('bufferutil');\nconst crypto = require('crypto');\n\nconst source = crypto.randomBytes(10);\nconst mask = crypto.randomBytes(4);\n\nbufferUtil.mask(source, mask, source, 0, source.length);\n```\n\n### `bufferUtil.unmask(buffer, mask)`\n\nUnmasks a buffer using the given masking-key as specified by the WebSocket\nprotocol.\n\n#### Arguments\n\n- `buffer` - The buffer to unmask.\n- `mask` - A buffer representing the masking-key.\n\n#### Example\n\n```js\n'use strict';\n\nconst bufferUtil = require('bufferutil');\nconst crypto = require('crypto');\n\nconst buffer = crypto.randomBytes(10);\nconst mask = crypto.randomBytes(4);\n\nbufferUtil.unmask(buffer, mask);\n```\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1545552472401,"_cnpm_publish_time":1545552472401,"dist-tags":{"latest":"4.1.0","n-api":"3.0.3-napi"}}