🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

buffer-slice

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer-slice

slice a buffer into an array of sub buffers

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

buffer-slice

Slice a buffer into an array of sub-buffers of a specified size.

Very handy for UDP packets.

install

npm install buffer-slice

api

[Buffer buffers] = bufferSlice(Buffer buffer, int maxLengthOfSlice);

example

var bufferSlice = require('buffer-slice');

//slice a length 5 buffer into max length 2
var buffers = bufferSlice(Buffer([1, 2, 3, 4, 5]), 2);
console.log(buffers);
//<Buffer 1 2>
//<Buffer 3 4>
//<Buffer 5>

license

MIT

Keywords

slice

FAQs

Package last updated on 30 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts