Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

microbuffer

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

microbuffer

Light implementation of binary buffer with helpers for easy access.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

microbuffer

Build Status NPM version

Light implementation of binary buffer with helpers for easy access.

This library was written for fontello's font convertors - svg2ttf ttf2woff ttf2eot. Main features are:

  • good speed & compact size (no dependencies)
  • transparent typed arrays support in browsers
  • methods to simplify binary data read/write

API

Constructor

  • new MicroBuffer(microbuffer [, offset, length]) - wrap MicroBuffer instanse, sharing the same data.
  • new MicroBuffer(Uint8Array|Array [, offset, length]) - wrap Uint8Array|Array.
  • new MicroBuffer(size) - create new MicroBuffer of specified size.

Methods

  • .getUint8(pos)
  • .getUint16(pos, littleEndian)
  • .getUint32(pos, littleEndian)
  • .setUint8(pos, value)
  • .setUint16(pos, value, littleEndian)
  • .setUint32(pos, value, littleEndian)

With position update:

  • .writeUint8(value)
  • .writeInt8(value)
  • .writeUint16(value, littleEndian)
  • .writeInt16(value, littleEndian)
  • .writeUint32(value, littleEndian)
  • .writeInt32(value, littleEndian)
  • .writeUint64(value)

Other:

  • .seek(pos)
  • .fill(value)
  • .writeBytes(Uint8Array|Array)
  • .toString()
  • .toArray()

Keywords

FAQs

Package last updated on 11 Apr 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc