🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

fatbuffer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fatbuffer

a Buffer but a fat one.

0.0.2
latest
Source
npm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Node FatBuffer

NodeJS Buffer interface has a maximum length of 2147483647 bytes, but what if we need more ?

One solution is to distribute the data on multiple buffers and map each index to one of the buffers. This is what the library is about, no need to do the mapping, you'll get the same interface as the original 'Buffer' but with infinite Buffer size which is around (2147483647 * 2^32 -1) = 9 x 10^9 gb).

Build Status bitHound Dependencies bitHound Overall Score issues stars license

Limitations:

not all Buffer methods are supported.

Installation

npm install fatbuffer --save

Initializing a FatBuffer

FatBuffer.alloc(length)
Methods:

.isBuffer(obj)

returns true if obj was a Buffer or an instance of FatBuffer.

.isFatBuffer(obj)

returns  true if obj was an instance of FatBuffer.
Parameters:
length: length in bytes.

Properties

.length

Returns length in bits.
Usage
const FatBuffer = require("fatbuffer")

const buffer = FatBuffer.alloc(2147483647*5);

buffer[2147483647*3]=255;
console.log(buffer[2147483647*3]) // 255


Implementation

Array of buffers and some mapping techniques.

Keywords

fat

FAQs

Package last updated on 06 Apr 2018

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