New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jdataview

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jdataview - npm Package Compare versions

Comparing version

to
2.3.1

4

package.json
{
"name": "jdataview",
"version": "2.3.0",
"version": "2.3.1",
"description": "A unique way to work with a binary file in the browser and the server.",
"keywords": ["buffer", "binary", "data", "file", "dataview", "read", "write", "manipulation"],
"homepage": "http://blog.vjeux.com/2011/javascript/jdataview-read-binary-file.html",
"homepage": "http://jDataView.github.io/",
"author": "Vjeux <vjeuxx@gmail.com> (http://blog.vjeux.com/)",

@@ -8,0 +8,0 @@ "contributors": [

@@ -175,3 +175,7 @@ //

if (!(buffer instanceof ArrayBuffer)) {
buffer = buffer instanceof Uint8Array ? buffer.buffer : new Uint8Array(buffer).buffer;
buffer = new Uint8Array(buffer).buffer;
// bug in Node.js <= 0.8:
if (buffer instanceof Uint8Array) {
buffer = new Uint8Array(arrayFrom(buffer, true)).buffer;
}
}

@@ -253,2 +257,3 @@ } else

_offset: 0,
_bitOffset: 0,

@@ -292,7 +297,4 @@ compatibility: compatibility,

this._offset = byteOffset + dataTypes[type];
var nodeName = nodeNaming[type] + ((type === 'Int8' || type === 'Uint8') ? '' : littleEndian ? 'LE' : 'BE');
byteOffset += this.byteOffset;
return isReadAction ? this.buffer['read' + nodeName](byteOffset) : this.buffer['write' + nodeName](value, byteOffset);

@@ -467,3 +469,3 @@ },

// Compatibility functions on a String Buffer
// Compatibility functions

@@ -566,2 +568,29 @@ _getFloat64: function (byteOffset, littleEndian) {

getSigned: function (bitLength, byteOffset) {
var shift = 32 - bitLength;
return (this.getUnsigned(bitLength, byteOffset) << shift) >> shift;
},
getUnsigned: function (bitLength, byteOffset) {
var startBit = (defined(byteOffset, this._offset) << 3) + this._bitOffset,
endBit = startBit + bitLength,
start = startBit >>> 3,
end = (endBit + 7) >>> 3,
b = this._getBytes(end - start, start, true),
value = 0;
/* jshint boss: true */
if (this._bitOffset = endBit & 7) {
this._bitOffset -= 8;
}
for (var i = 0, length = b.length; i < length; i++) {
value = (value << 8) | b[i];
}
value >>>= -this._bitOffset;
return bitLength < 32 ? (value & ~(-1 << bitLength)) : value;
},
_setBinaryFloat: function (byteOffset, value, mantSize, expSize, littleEndian) {

@@ -568,0 +597,0 @@ var signBit = value < 0 ? 1 : 0,