New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pypacker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pypacker

Handle binary strings in buffers similar to Python's struct library.

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

PyPacker

pypacker is a binary packer and unpacker inspired by Python's struct library for node.js. Currently, it packs/unpacks to and from a Buffer object. When unpacking, an array is returned with the requested values.

Interfacing is exactly the same as the Python struct python class except there are no 8-byte integers.

Installation

npm install pypacker

Usage

Packer = require('pypacker');
var unpack_array = new Packer('>H')
  .unpack(new Buffer([0x00, 0x01]));
// unpack_array will be an array containing [1]

var packed_buffer = new Packer('>H')
  .pack(1);
// packed_buffer will be a Buffer of length 2 containing 00 01

FAQs

Package last updated on 19 Aug 2012

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