4.0.8 • Published 6 months ago

bufferutil v4.0.8

Weekly downloads
1,397,057
License
MIT
Repository
github
Last release
6 months ago

bufferutil

Version npm Linux/macOS/Windows Build

bufferutil is what makes ws fast. It provides some utilities to efficiently perform some operations such as masking and unmasking the data payload of WebSocket frames.

Installation

npm install bufferutil --save-optional

The --save-optional flag tells npm to save the package in your package.json under the optionalDependencies key.

API

The module exports two functions.

bufferUtil.mask(source, mask, output, offset, length)

Masks a buffer using the given masking-key as specified by the WebSocket protocol.

Arguments

  • source - The buffer to mask.
  • mask - A buffer representing the masking-key.
  • output - The buffer where to store the result.
  • offset - The offset at which to start writing.
  • length - The number of bytes to mask.

Example

'use strict';

const bufferUtil = require('bufferutil');
const crypto = require('crypto');

const source = crypto.randomBytes(10);
const mask = crypto.randomBytes(4);

bufferUtil.mask(source, mask, source, 0, source.length);

bufferUtil.unmask(buffer, mask)

Unmasks a buffer using the given masking-key as specified by the WebSocket protocol.

Arguments

  • buffer - The buffer to unmask.
  • mask - A buffer representing the masking-key.

Example

'use strict';

const bufferUtil = require('bufferutil');
const crypto = require('crypto');

const buffer = crypto.randomBytes(10);
const mask = crypto.randomBytes(4);

bufferUtil.unmask(buffer, mask);

License

MIT

websocketws-callback@bhunter179/telegramjs@andersea/nrc-bws@feltcoop/felt-server@open-oracle-origami/origami-js-mill-coinbase@open-oracle-origami/origami-js-museum-consoleatproto-event-streams@arthswap/widgets@inc/fastify-ws@openos.com/uniswap@fintom/utilaskless-javascript-clientlolli.jswizzy-serverotc-sdkewokin.rssnwblibrarytestbittorrent-tracker-ssldebox-web-corefiibotsimple-easy-musicbuerli-nodeui-gallery@thebestco/pubsubcenterfold@autovance/customer-translator@joseirrazabal/linksreactive-dao-websocket@kontikijs/vite-plugin-vue-kontiki@igotcha/html-screenshotx0x0x-serverustack-halohost-democexpress-objection-starter@kurtzgmbh/front-react-apppangea-widgetsaurorarpc-client@redesblock/hop.jsdjs-aura@a1pos/enginediscord-wraxie-animationnfc-daemontaurus-node@eipgrid/s1@infinitebrahmanuniverse/nolb-bufdiscord-applicationdiscord-application-launcherhalsey-botrexom.jsliveserver-backendlit-js-sdk@everything-registry/sub-chunk-1272@ksoft/chatwatch@squidcloud/commondbgate-apideba-kerneljsdebug-adapter-for-office-addinsdate-to-block-eth@denota-labs/denota-sdk@derpdex/widgetsdeno-uniswapwidgetdeocoincore-node@divswap/widgets@develable/develable-noticedenariicore-node@distributed/vercel-builder@dls-controls/cs-web-lib@datagrok/notebooksdatasoledffrnt.routedfxdeepstream.io-client-js@devbookhq/rpc-websockets@devoralime/nightcat-serverdeepbot-simulator@dokit/autotest-core@deploysentinel/cypress-debugger@dreamofdark/jupyterlab-mind-mapdigibyte-nodedigicoin-bitcore-nodediag@devicefarmer/stf@datalayer/jupyter-react@dataverse/dataverse-connectordct-file-service@demo-services/demo-image-service@demo-services/demo-layer-testdbans-clifactory-xfastify-simple-wsfamousaffccs-sdkfbx-sdkffcs-test-bimmferifeathercore-nodeextws-clientezcore
4.0.8

6 months ago

4.0.7

2 years ago

4.0.6

2 years ago

4.0.5

3 years ago

4.0.4

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.1

5 years ago

4.0.0

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3-napi

6 years ago

3.0.3

6 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.3.0

7 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago