{"name":"bufferutil","version":"3.0.5","description":"WebSocket buffer utils","main":"index.js","scripts":{"install":"prebuild-install || node-gyp rebuild","test":"mocha && prebuild-ci"},"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":{"bindings":"~1.3.0","nan":"~2.10.0","prebuild-install":"~4.0.0"},"devDependencies":{"mocha":"~5.1.0","prebuild":"~7.6.0","prebuild-ci":"~2.2.0"},"gitHead":"765fbe58a9a2a03ac49119966455510c419f0b35","_id":"bufferutil@3.0.5","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"lpinca","email":"luigipinca@gmail.com"},"dist":{"integrity":"sha512-0fUEthLqfCkYspEuP0vmiAe+PsXslE+AlILb2rmS9I4tAdm3SmpCI69M66zQL20GQEszdbXyVN6q+cpG/yhYlg==","shasum":"8abfc3b6da7aca6a13268b3f2482f0c7aa05fffb","tarball":"http://registry-npm.ywwl.com/bufferutil/download/bufferutil-3.0.5.tgz","fileCount":7,"unpackedSize":7798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa7peECRA9TVsSAnZWagAAzYcP/RUjc5RFATHCKHKPGOL7\nXHdjE1NGEIx635yOzKB10nJpEpQy022Qhg2k91vPwLfH7APW+Uf1Gm07NI1X\nsEt0PC9t9RVSWVDGggT3emcvYbgumSJej3vel0IGLSpUUsb663XNaeAcdMk0\nEU6ZrCkihEbElUvyqUczNEGjyJQ9sjGE8eN8MaDttjZk8w7UYDeNioWctkn1\nqqw/FLcknRlmyiyJt15hXdrnepDNFDDAp7M+WU7sVQ+g1g3ojlInoOb72n6J\np3FFf0Th2cZRY7LSUPEq7IyElYQmVYEqF75T0nXPcd4BPgdrJcs7c6sqzRn7\nHndKdC/joTi3ZXSg7wC6zoU3nnBoFHLUmnXGwbmRR2H3HY0XrHhvwZV2MTFC\n94I6ZpKr5dRsoisV/wZGDowUtaR3OjnO82UXsFzdN7XA5A1IdQSbBCLzy3O1\ndVH4Ar8su/TzVK/ZZ+YKhjCKO7Awx+FtaARiaSuNPWkBpBFphCQ708tp6jNO\ng9PdK/n1n3nIGBoJNn1D1YJC4Tx6Vw7sWb+xN1Vd3Sj8iY2CYWqkbAPtrE++\nBZ7Qj+xcBb9FavjVnfAbQe8zkLiRbvWzLB1llB/rHFhBi1x9BJ786VkCB8xf\ncqEyatWEfqODeXXzgGoNuQQPf4bh38dC9spMtQxKKEpcyAUUtEyI8stC126U\noMTG\r\n=wTUL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChZsicZnedjrCluLbV3OcmMBICsisb9g6+UYne8eKhJwIgJKK7xLT5OIwhrUHyj8ud3S45lFDnzdEZBJjwNESyE0M="}],"size":3093,"noattachment":false,"key":"/bufferutil/-/bufferutil-3.0.5.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_3.0.5_1525585795627_0.6340993025004453"},"_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":1525585795725,"_cnpm_publish_time":1525585795725,"dist-tags":{"latest":"4.1.0","n-api":"3.0.3-napi"}}