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

@gmod/binary-parser

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gmod/binary-parser - npm Package Compare versions

Comparing version 1.3.4 to 1.3.5

30

dist/binary_parser.js

@@ -26,3 +26,5 @@ "use strict";function _typeof(obj) {if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {_typeof = function _typeof(obj) {return typeof obj;};} else {_typeof = function _typeof(obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};}return _typeof(obj);} //= =======================================================================================

DoubleLE: 8,
DoubleBE: 8 };
DoubleBE: 8,
UInt64: 8,
Int64: 8 };

@@ -463,7 +465,21 @@

Parser.prototype["generate".concat(type)] = function (ctx) {
ctx.pushCode(
"{0} = buffer.read{1}(offset);",
ctx.generateVariable(this.varName),
type);
if (type === 'UInt64') {
ctx.pushCode(
"{0} = Long.fromBytes(buffer.slice(offset,offset+8), true, this.endian === 'le').toNumber();",
ctx.generateVariable(this.varName),
type);
} else if (type === 'Int64') {
ctx.pushCode(
"{0} = Long.fromBytes(buffer.slice(offset,offset+8), false, this.endian === 'le').toNumber();",
ctx.generateVariable(this.varName),
type);
} else {
ctx.pushCode(
"{0} = buffer.read{1}(offset);",
ctx.generateVariable(this.varName),
type);
}
ctx.pushCode("offset += {0};", PRIMITIVE_TYPES[type]);

@@ -753,5 +769,9 @@ };

// /////////////////// CRAM-specific types //////////////////////////
//
Parser.prototype.itf8 = function (varName, options) {
return this.setNextParser("itf8", varName, options);
};
Parser.prototype.itf8 = function (varName, options) {
return this.setNextParser("itf8", varName, options);
};

@@ -758,0 +778,0 @@ Parser.prototype.generateItf8 = function (ctx) {

@@ -26,3 +26,5 @@ //= =======================================================================================

DoubleLE: 8,
DoubleBE: 8
DoubleBE: 8,
UInt64: 8,
Int64: 8
};

@@ -463,7 +465,21 @@

Parser.prototype[`generate${type}`] = function(ctx) {
ctx.pushCode(
"{0} = buffer.read{1}(offset);",
ctx.generateVariable(this.varName),
type
);
if (type === "UInt64") {
ctx.pushCode(
"{0} = Long.fromBytes(buffer.slice(offset,offset+8), true, this.endian === 'le').toNumber();",
ctx.generateVariable(this.varName),
type
);
} else if (type === "Int64") {
ctx.pushCode(
"{0} = Long.fromBytes(buffer.slice(offset,offset+8), false, this.endian === 'le').toNumber();",
ctx.generateVariable(this.varName),
type
);
} else {
ctx.pushCode(
"{0} = buffer.read{1}(offset);",
ctx.generateVariable(this.varName),
type
);
}
ctx.pushCode("offset += {0};", PRIMITIVE_TYPES[type]);

@@ -753,5 +769,9 @@ };

// /////////////////// CRAM-specific types //////////////////////////
//
Parser.prototype.itf8 = function(varName, options) {
return this.setNextParser("itf8", varName, options);
};
Parser.prototype.itf8 = function(varName, options) {
return this.setNextParser("itf8", varName, options);
};

@@ -758,0 +778,0 @@ Parser.prototype.generateItf8 = function(ctx) {

2

package.json
{
"name": "@gmod/binary-parser",
"version": "1.3.4",
"version": "1.3.5",
"description": "Blazing-fast binary parser builder",

@@ -5,0 +5,0 @@ "main": "dist/binary_parser.js",

@@ -23,3 +23,7 @@

.buffer('mylong64bitint', { length: 8, formatter: function(buf) { return Long.fromBytes(buf, true, this.endian==='le').toNumber() } })
.uint64('mylong64bitint')
.int64('mylong64bitint')
64 bit infers from the endianess of the .endianess, doesn't use uint64le/be
Verification of whether it is valid 2^53 max int is not done for 64 bit either
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