You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

bodec

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bodec

bodec =====

0.1.0
Source
npmnpm
Version published
Weekly downloads
1.4M
6.19%
Maintainers
1
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 25 Jul 2014

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