Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

varintes

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

varintes - npm Package Compare versions

Comparing version 2.0.0-a.2 to 2.0.0-a.3

3

dist/decode.d.ts

@@ -5,4 +5,5 @@ /**

* @param buffer - input that contains an encoded varint.
* @param offset
* @return [decoded-varint, bytes-read]
*/
export declare function decode(buffer: Uint8Array): [number, number];
export declare function decode(buffer: Uint8Array, offset?: number): [number, number];

@@ -19,7 +19,8 @@ const MSB = 0x80; // 1000 0000

* @param buffer - input that contains an encoded varint.
* @param offset
* @return [decoded-varint, bytes-read]
*/
export function decode(buffer) {
export function decode(buffer, offset = 0) {
let result = 0;
let bytesRead = 0;
let bytesRead = offset;
let byte = 0;

@@ -36,3 +37,3 @@ let shift = 0;

}
return [result, bytesRead];
return [result, bytesRead - offset];
}
{
"name": "varintes",
"version": "2.0.0-a.2",
"version": "2.0.0-a.3",
"description": "Unsigned Varint encoding and decoding, exposed as ESModule",

@@ -21,3 +21,2 @@ "keywords": [

],
"main": "dist/index.js",
"sideEffects": false,

@@ -24,0 +23,0 @@ "typesVersions": {

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