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

bodec

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bodec

bodec =====

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
decreased by-0.54%
Maintainers
2
Weekly downloads
 
Created

What is bodec?

Bodec is a simple library for working with binary data in JavaScript. It provides utilities for encoding and decoding binary data, as well as manipulating binary buffers.

What are bodec's main functionalities?

Encoding and Decoding

This feature allows you to encode a string into a binary buffer and decode a binary buffer back into a string. It is useful for handling binary data in applications.

const bodec = require('bodec');

// Encoding a string to a binary buffer
const buffer = bodec.fromUnicode('Hello, World!');
console.log(buffer);

// Decoding a binary buffer to a string
const string = bodec.toUnicode(buffer);
console.log(string);

Binary Buffer Manipulation

This feature allows you to create and manipulate binary buffers. You can create a buffer from an array of bytes and slice a buffer to get a sub-buffer.

const bodec = require('bodec');

// Creating a binary buffer from an array
const buffer = bodec.create([0x48, 0x65, 0x6c, 0x6c, 0x6f]);
console.log(buffer);

// Slicing a binary buffer
const slice = bodec.slice(buffer, 1, 4);
console.log(slice);

Other packages similar to bodec

FAQs

Package last updated on 20 Jan 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