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

struct

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

struct - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

samples/issue2.js

14

index.js

@@ -44,3 +44,2 @@ var Proxy = require('node-proxy');

function getSVal(bor){
debugger;
var val = getUVal(bor);

@@ -70,12 +69,12 @@ if ((p.buf[offset + (le?(length-1):0)] & 0x80) == 0x80) {

function charField(p,offset,length)
function charField(p,offset,length,encoding)
{
this.length = length;
this.encoding = encoding;
this.get = function(){
return p.buf.toString('ascii',offset,offset+length);
return p.buf.toString(this.encoding,offset,offset+length);
}
this.set = function(val){
debugger;
if(val.length > length) val = val.substring(0,length);
p.buf.write(val,offset,'ascii');
p.buf.write(val,offset,this.encoding);
}

@@ -112,3 +111,2 @@ }

{
debugger;
args[0] = i;

@@ -182,6 +180,6 @@ as[type].apply(as,args);

this.chars = function(key,length){
this.chars = function(key,length,encoding){
checkAllocated();
priv.closures.push(function(p){
p.fields[key] = new charField(p,p.len,length);
p.fields[key] = new charField(p,p.len,length,encoding||'ascii');
p.len += length;

@@ -188,0 +186,0 @@ });

{ "name" : "struct"
, "version" : "v0.0.2"
, "version" : "v0.0.3"
, "description" : "Pack/Unpack multibyte binary values from/to buffers "

@@ -4,0 +4,0 @@ , "author": "Denys Khanzhiyev"

@@ -87,4 +87,4 @@ Struct

### chars(name,length)
defines array of chars in 'ascii' encoding, name - name of the field, length - length of array
### chars(name,length[,encoding])
defines array of chars with `encoding` ('ascii' by default) encoding, name - name of the field, length - length of array

@@ -91,0 +91,0 @@ ### array(name, length, type, ...)

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