Socket
Socket
Sign inDemoInstall

int24

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

int24

24-bit integer serialization


Version published
Weekly downloads
4.1K
decreased by-8.93%
Maintainers
1
Weekly downloads
 
Created
Source

int24

Build Status

int24 is a simple utility library for serializing 24-bit integers.

Why is this useful?

A really good question. Probably not very useful to most people. I needed this for work I'm doing in Node.js with the Hadoop Writable serialization (e.g. VLong), so I figured I'd share what I used.

Example

var int24 = require('int24');

var buf = new Buffer(3); //  3 byte Buffer
int24.writeUInt24BE(buf, 0, 16777215); // writes out 0xFFFFFF to the buffer at offset 0

var val;
var buf = new Buffer([0x01, 0x02, 0x03]);
val = int24.readInt24LE(buf, 0); // 197121
val = int24.readInt24BE(buf, 0); // 66051

Install

npm install int24

Tests

npm test

License

MIT License

Keywords

FAQs

Package last updated on 25 Jun 2013

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