Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

uint8arraylist

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uint8arraylist

Append and consume bytes using only no-copy operations

Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
235K
-5.69%
Maintainers
1
Weekly downloads
 
Created
Source

Uint8ArrayList

Append and consume bytes using only no-copy operations

Install

$ npm i uint8arraylist

Usage

import { Uint8ArrayList } from 'uint8arraylist'

const list = new Uint8ArrayList()
list.append(Uint8Array.from([0, 1, 2]))
list.append(Uint8Array.from([3, 4, 5]))

list.toUint8Array()
// -> Uint8Array([0, 1, 2, 3, 4, 5])

list.consume(3)
list.toUint8Array()
// -> Uint8Array([3, 4, 5])

// you can also iterate over the list
for (const buf of list) {
  // ..do something with `buf`
}

Inspiration

Borrows liberally from bl but only uses native JS types.

FAQs

Package last updated on 04 Feb 2022

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