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

obuf

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obuf

Byte buffer specialized for data in chunks with special cases for dropping bytes in the front, merging bytes in to various integer types and abandoning buffer without penalty for previous chunk merges.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is obuf?

The `obuf` npm package is designed for efficient binary data manipulation. It allows for operations such as appending, slicing, and transforming binary data in a buffer. This package is particularly useful for applications that require direct manipulation of binary data, such as networking applications, file I/O operations, and data serialization/deserialization tasks.

What are obuf's main functionalities?

Appending data

This feature demonstrates how to append data to the buffer. It includes appending both a UInt8 and a string to the buffer.

"use strict";\nconst OBuffer = require('obuf');\nlet buffer = new OBuffer();\nbuffer.writeUInt8(0x01);\nbuffer.writeString('Hello, World!');"

Slicing data

This feature shows how to slice a portion of the buffer. It creates a slice of the buffer from index 0 to 5.

"use strict";\nconst OBuffer = require('obuf');\nlet buffer = new OBuffer();\nbuffer.writeUInt8(0x01);\nbuffer.writeString('Hello, World!');\nlet slice = buffer.slice(0, 5);"

Transforming data

This feature illustrates how to transform the data in the buffer. It applies a transformation function to each byte in the buffer, in this case, XORing each byte with 0xff.

"use strict";\nconst OBuffer = require('obuf');\nlet buffer = new OBuffer();\nbuffer.writeUInt8(0x01);\nbuffer.transform(data => {\n  // Transform the data\n  return data.map(byte => byte ^ 0xff);\n});"

Other packages similar to obuf

Keywords

FAQs

Package last updated on 10 Mar 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

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