{"name":"bufferutil","version":"4.0.3","description":"WebSocket buffer utils","main":"index.js","scripts":{"install":"node-gyp-build","prebuild":"prebuildify --napi --strip","prebuild-linux-arm":"prebuildify-cross -i linux-armv6 -i linux-armv7 --napi --strip","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":"^4.2.0"},"devDependencies":{"mocha":"^8.0.1","node-gyp":"^7.1.2","prebuildify":"^4.0.0","prebuildify-cross":"^4.0.0"},"gitHead":"a506f9b7473662f9daea3fbd5e08cfb8c9a685a3","_id":"bufferutil@4.0.3","_nodeVersion":"15.5.0","_npmVersion":"7.3.0","dist":{"integrity":"sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==","shasum":"66724b756bed23cd7c28c4d306d7994f9943cc6b","tarball":"http://registry-npm.ywwl.com/bufferutil/download/bufferutil-4.0.3.tgz","fileCount":14,"unpackedSize":289573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8NLSCRA9TVsSAnZWagAAKP0P/2k6qW4JiSlYXfGlGRoz\ne/7dktVxEW5pQhPa033Ho+C83vTNwHWc2MTlk9WzKluY4glDSN3VxaFYWi3o\n1B+FrrLaNKDSSFOC4ziZ9N8Z0bHSk4GajwVVF9NSAvf+n8whx1jBZr1VUYp4\nREE+xOws8a1nzSyT8e2ZK8FDlCbaDHzfIsAy4iRiWCGZ/D+AiUCnQMAaNVJ0\ndExu3llbrT+jKrsmAP0lZ+qeHxZwbQTt7JCT1DJkKBw8bcKRN6tzRKL9YA15\nFdUj0WDAtozDTt9Slyl3PpweNuCpy7o0K9YwUcSCXiP9xR02k7mP/9+emVAF\nvlDTNgVOnMZYKWdOT6RlUkjhRFjljlJPez5BWy6Kv5x671FBBFOAgli0qAG0\nQ32o6k5vODv3yKnqeMIlifwUrYKjM/r8F+5gkdg43Sw0rYn06AumP1q1/6pY\n4OMiRvmZmTpyE2Czz14w1aOdFqru5lKIVb3qMqVHYr0w4n8MmflciiKSr/qa\nca8ziismpMIEyi0/qVjSosciXhjYXk1SkLsrhgHRvc0L8xmttvw+7E0kiHhR\nhn7hwMCoD0d70sWKttpeuCJebDD7iO46QAueFNN75Jejo0oU5uGbeCTO6IzY\ngbdHcsuj5C1HnLlALY6qPj+mzYLiIrKnt/YsNz5WP4nEacVn2tbbjm+OBuI9\ni+Qo\r\n=y72D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDplP/OB2wvKo3MdaEj5n6kkcF376hPRTDK6Q3GnrhhrgIgbL2Bmvqmw+qr0uWI55uT4Y9uAuPbw/5xmFEC5kxesI0="}],"size":142459,"noattachment":false,"key":"/bufferutil/-/bufferutil-4.0.3.tgz"},"_npmUser":{"name":"lpinca","email":"luigipinca@gmail.com"},"directories":{},"maintainers":[{"name":"einaros","email":"einaros@gmail.com"},{"name":"lpinca","email":"luigipinca@gmail.com"},{"name":"3rdeden","email":"npmjs@3rd-Eden.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bufferutil_4.0.3_1609618129628_0.7610264455425453"},"_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":1609618129791,"_cnpm_publish_time":1609618129791,"dist-tags":{"latest":"4.1.0","n-api":"3.0.3-napi"}}