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

@aryzing/varint

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aryzing/varint

Encode and decode `varint`s.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
0
Weekly downloads
 
Created
Source

varint

Usage:

import { encode, decode } from "@aryzing/varint";

encode(1);     // Uint8Array(1) [ 1 ]
encode(127);   // Uint8Array(1) [ 127 ]
encode(128);   // Uint8Array(2) [ 128, 1 ]
encode(255);   // Uint8Array(2) [ 255, 1 ]
encode(300);   // Uint8Array(2) [ 172, 2 ]
encode(16384); // Uint8Array(3) [ 128, 128, 1 ]

decode(new Uint8Array([1]));           // 1n
decode(new Uint8Array([127]));         // 127n
decode(new Uint8Array([128, 1]));      // 128n
decode(new Uint8Array([255, 1]));      // 255n
decode(new Uint8Array([172, 2]));      // 300n
decode(new Uint8Array([128, 128, 1])); // 16384n

FAQs

Package last updated on 20 Dec 2024

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