
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
compact-uint
Advanced tools
Compact Size Unsigned Integers in JS
npm install compact-uint
const cuint = require('compact-uint')
cuint.encode(12) // -> Buffer([0x0c])
cuint.encode(123) // -> Buffer([0x7b])
cuint.encode(1234) // -> Buffer([0xfc04d2])
buf = cuint.encode(uint, [buf], [offset])Encodes a uint into a buffer using the compact size spec.
After encoding encode.bytes is set to the number of bytes that was used to encode the number.
len = cuint.encodingLength(uint)How many bytes are needed to encode a uint?
uint = cuint.decode(buf, [offset])Decode a uint from a buffer.
After decoding decode.bytes is set to the number of bytes that was used to decode the number.
MIT
FAQs
Compact Size Unsigned Integers
We found that compact-uint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.