Comparing version 0.0.2 to 0.0.3
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, ...) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
14860
8
333
1