{"name":"bufferutil","version":"4.1.0","keywords":["bufferutil"],"author":{"url":"http://2x.io","name":"Einar Otto Stangvik","email":"einaros@gmail.com"},"license":"MIT","_id":"bufferutil@4.1.0","maintainers":[{"name":"einaros","email":"einaros@gmail.com"},{"name":"lpinca","email":"luigipinca@gmail.com"},{"name":"3rdeden","email":"npmjs@3rd-Eden.com"}],"homepage":"https://github.com/websockets/bufferutil","bugs":{"url":"https://github.com/websockets/bufferutil/issues"},"dist":{"shasum":"a4623541dd23867626bb08a051ec0d2ec0b70294","tarball":"http://registry-npm.ywwl.com/bufferutil/download/bufferutil-4.1.0.tgz","fileCount":12,"integrity":"sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==","signatures":[{"sig":"MEYCIQDql6lkSKOOQvihQ/DsSc7+F2aOWzYyOp95n2X4vUV0EgIhAMxutIDmC0qp1BrC8ZjKMlwPtBnhjcqPuESABpM+4zzO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":350988,"size":163631,"noattachment":false,"key":"/bufferutil/-/bufferutil-4.1.0.tgz"},"main":"index.js","engines":{"node":">=6.14.2"},"gitHead":"580a8a92c91d1b3dea6d4b0d54f89daf42da5e48","scripts":{"test":"mocha","install":"node-gyp-build","prebuild":"prebuildify --napi --strip --target=8.11.2"},"_npmUser":{"name":"lpinca","email":"luigipinca@gmail.com"},"repository":{"url":"git+https://github.com/websockets/bufferutil.git","type":"git"},"_npmVersion":"11.6.2","description":"WebSocket buffer utils","directories":{},"_nodeVersion":"25.2.1","dependencies":{"node-gyp-build":"^4.3.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^11.0.1","node-gyp":"^12.1.0","prebuildify":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bufferutil_4.1.0_1766075061409_0.6905188416245664","host":"s3://npm-registry-packages-npm-production"},"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. To maximize performance, parameters are not\nvalidated. It is the caller's responsibility to ensure that they are correct.\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":1766075061551,"_cnpm_publish_time":1766075061551,"dist-tags":{"latest":"4.1.0","n-api":"3.0.3-napi"}}