{"name":"bufferutil","version":"4.0.7","description":"WebSocket buffer utils","main":"index.js","engines":{"node":">=6.14.2"},"scripts":{"install":"node-gyp-build","prebuild":"prebuildify --napi --strip --target=14.0.0","prebuild-darwin-x64+arm64":"prebuildify --arch x64+arm64 --napi --strip --target=14.0.0","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.3.0"},"devDependencies":{"mocha":"^10.0.0","node-gyp":"^9.1.0","prebuildify":"^5.0.0"},"gitHead":"b90f4d22a8a67e1609a10bb8cd01b3e7b13e5cb5","_id":"bufferutil@4.0.7","_nodeVersion":"18.11.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==","shasum":"60c0d19ba2c992dd8273d3f73772ffc894c153ad","tarball":"http://registry-npm.ywwl.com/bufferutil/download/bufferutil-4.0.7.tgz","fileCount":11,"unpackedSize":409448,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTzt3sEp25mrnYpyUDt362DXMtUiDKoVZMkmCNp6uslQIgN6flOhrjk4L8uObSvjT+m754G5SF5Wu2ZKp9A5C9AY8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTqxCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXmA/+JEy9p61MztVQhxA8tfEdRYzatyDGqkq6USv1+Mbr00yZkFea\r\nnrJTMhXPD6xSTXYw8r5lvf9xrCqG3FDBJmOQhnDSgcizOB2nbjx+ZwkJi2f2\r\nFUHRHj7lKF9+cwPyabY2q5IaG15vwnAoB6ya2OeagdkIGd/SIepc7K2/N3Jw\r\n91podWmc0i7PL6ZYoutb2FXloPxMAkyLXYGe5EF03kzKpnAT1rgfxJ71FxIc\r\n1Jt8IAZLEatoD60kdor1xPnaxOoSrwP+0GAMBDsain6rVMoF8mhPWMMqqwVj\r\nZw20+CjTsb7QoWN523lNRb3RXoCdz+m3fSw2GyfpvrvMgHbgaJ7mzC8IhwL2\r\nGZz7GEDsSi0nMsoj/loUUBXHGEtZJjTeYSIEIzvQRSIP+ETzRB+lAL3c+w1z\r\n/cxas9i0d5FSlZkKPzlPyzaX7ejzJgbQfW/NkY5+AdL8xb3eal0jxOfEa013\r\nqSQa0JMr0nqtQH6AxmtcGI4ppc0kNdeBiGfOA1OfJZm91/bAbhRfDNz4YUPy\r\nKE1Iu9bBE3Hs4LtUZ6UDNu6EKdDuI6uyQ8MywUpajH1fEAU8NrfC01q3AKic\r\nYK8dI9LM5qGNY8r55pI6fwg7LpXME8mmWIopwDMpTvf24JxUBNKkmrv0OLW3\r\nQLwPCt8mvow+Tebwpfq7zdi7kUc+DDlzvTg=\r\n=GQES\r\n-----END PGP SIGNATURE-----\r\n","size":162162,"noattachment":false,"key":"/bufferutil/-/bufferutil-4.0.7.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.7_1666100290604_0.7387029965195444"},"_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":1666100290830,"_cnpm_publish_time":1666100290830,"dist-tags":{"latest":"4.1.0","n-api":"3.0.3-napi"}}