Socket
Socket
Sign inDemoInstall

bufio

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bufio - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

26

lib/struct.js

@@ -67,2 +67,6 @@ /*!

from(options, extra) {
return this.fromOptions(options, extra);
}
format() {

@@ -97,3 +101,10 @@ return this.getJSON();

assert(typeof str === 'string');
return this.decode(Buffer.from(str, 'hex'));
const size = str.length >>> 1;
const data = Buffer.from(str, 'hex');
if (data.length !== size)
throw new Error('Invalid hex string.');
return this.decode(data, extra);
}

@@ -107,3 +118,10 @@

assert(typeof str === 'string');
return this.decode(Buffer.from(str, 'base64'));
const min = (((str.length - 3) & ~3) * 3) / 4 | 0;
const data = Buffer.from(str, 'base64');
if (data.length < min)
throw new Error('Invalid base64 string.');
return this.decode(data, extra);
}

@@ -151,2 +169,6 @@

static from(options, extra) {
return new this().from(options, extra);
}
/*

@@ -153,0 +175,0 @@ * Aliases

2

package.json
{
"name": "bufio",
"version": "0.0.3",
"version": "0.0.4",
"description": "Buffer and serialization utilities for javascript",

@@ -5,0 +5,0 @@ "keywords": [

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