python-struct
Advanced tools
Comparing version 1.0.2 to 1.0.3
50
index.js
@@ -239,6 +239,6 @@ const Long = require('long'); | ||
const LITTLE_ENDIAN_MAP = { | ||
'x': [ 1, 1, null, null ], | ||
'x': [ 1, 0, null, null ], | ||
'c': [ | ||
1, | ||
1, | ||
0, | ||
function (data, pos) { return String.fromCharCode(data[pos]) }, | ||
@@ -249,3 +249,3 @@ function (data, pack, pos) { pack[pos] = data.charCodeAt(0) } | ||
1, | ||
1, | ||
0, | ||
function (data, pos) { return data.readInt8(pos) }, | ||
@@ -262,3 +262,3 @@ function (data, pack, pos) { pack.writeInt8(data, pos, true) } | ||
2, | ||
2, | ||
1, | ||
function (data, pos) { return data.readInt16LE(pos) }, | ||
@@ -269,13 +269,13 @@ function (data, pack, pos) { return pack.writeInt16LE(data, pos, true) } | ||
2, | ||
2, | ||
1, | ||
function (data, pos) { return data.readUInt16LE(pos) }, | ||
function (data, pack, pos) { return pack.writeUInt16LE(data, pos, true) } | ||
], | ||
'i': [ 4, 4, UNPACK_INT32_LE, PACK_INT32_LE ], | ||
'I': [ 4, 4, UNPACK_UINT32_LE, PACK_UINT32_LE ], | ||
'l': [ 4, 4, UNPACK_INT32_LE, PACK_INT32_LE ], | ||
'L': [ 4, 4, UNPACK_UINT32_LE, PACK_UINT32_LE ], | ||
'i': [ 4, 1, UNPACK_INT32_LE, PACK_INT32_LE ], | ||
'I': [ 4, 1, UNPACK_UINT32_LE, PACK_UINT32_LE ], | ||
'l': [ 4, 1, UNPACK_INT32_LE, PACK_INT32_LE ], | ||
'L': [ 4, 1, UNPACK_UINT32_LE, PACK_UINT32_LE ], | ||
'f': [ | ||
4, | ||
4, | ||
1, | ||
function (data, pos) { return data.readFloatLE(pos) }, | ||
@@ -286,3 +286,3 @@ function (data, pack, pos) { return pack.writeFloatLE(data, pos, true) } | ||
8, | ||
8, | ||
1, | ||
function (data, pos) { return data.readDoubleLE(pos) }, | ||
@@ -295,8 +295,8 @@ function (data, pack, pos) { return pack.writeDoubleLE(data, pos, true) } | ||
IS_64bit ? 8 : 4, | ||
IS_64bit ? 8 : 4, | ||
1, | ||
IS_64bit ? UNPACK_UINT64_LE : UNPACK_UINT32_LE, | ||
IS_64bit ? PACK_UINT64_LE : PACK_UINT32_LE | ||
], | ||
'q': [ 8, 8, UNPACK_INT64_LE, PACK_INT64_LE ], | ||
'Q': [ 8, 8, UNPACK_UINT64_LE, PACK_UINT64_LE ], | ||
'q': [ 8, 1, UNPACK_INT64_LE, PACK_INT64_LE ], | ||
'Q': [ 8, 1, UNPACK_UINT64_LE, PACK_UINT64_LE ], | ||
'?': [ | ||
@@ -332,3 +332,3 @@ 1, | ||
2, | ||
2, | ||
1, | ||
function (data, pos) { return data.readInt16BE(pos) }, | ||
@@ -339,13 +339,13 @@ function (data, pack, pos) { return pack.writeInt16BE(data, pos, true) } | ||
2, | ||
2, | ||
1, | ||
function (data, pos) { return data.readUInt16BE(pos) }, | ||
function (data, pack, pos) { return pack.writeUInt16BE(data, pos, true) } | ||
], | ||
'i': [ 4, 4, UNPACK_INT32_BE, PACK_INT32_BE ], | ||
'I': [ 4, 4, UNPACK_UINT32_BE, PACK_UINT32_BE ], | ||
'l': [ 4, 4, UNPACK_INT32_BE, PACK_INT32_BE ], | ||
'L': [ 4, 4, UNPACK_UINT32_BE, PACK_UINT32_BE ], | ||
'i': [ 4, 1, UNPACK_INT32_BE, PACK_INT32_BE ], | ||
'I': [ 4, 1, UNPACK_UINT32_BE, PACK_UINT32_BE ], | ||
'l': [ 4, 1, UNPACK_INT32_BE, PACK_INT32_BE ], | ||
'L': [ 4, 1, UNPACK_UINT32_BE, PACK_UINT32_BE ], | ||
'f': [ | ||
4, | ||
4, | ||
1, | ||
function (data, pos) { return data.readFloatBE(pos) }, | ||
@@ -356,3 +356,3 @@ function (data, pack, pos) { return pack.writeFloatBE(data, pos, true) } | ||
8, | ||
8, | ||
1, | ||
function (data, pos) { return data.readDoubleBE(pos) }, | ||
@@ -365,8 +365,8 @@ function (data, pack, pos) { return pack.writeDoubleBE(data, pos, true) } | ||
IS_64bit ? 8 : 4, | ||
IS_64bit ? 8 : 4, | ||
1, | ||
IS_64bit ? UNPACK_UINT64_BE : UNPACK_UINT32_BE, | ||
IS_64bit ? PACK_UINT64_BE : PACK_UINT32_BE | ||
], | ||
'q': [ 8, 8, UNPACK_INT64_BE, PACK_INT64_BE ], | ||
'Q': [ 8, 8, UNPACK_UINT64_BE, PACK_UINT64_BE ], | ||
'q': [ 8, 1, UNPACK_INT64_BE, PACK_INT64_BE ], | ||
'Q': [ 8, 1, UNPACK_UINT64_BE, PACK_UINT64_BE ], | ||
'?': [ | ||
@@ -373,0 +373,0 @@ 1, |
{ | ||
"name": "python-struct", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Packs/Unpacks/Measures structs according to Python's `struct` format", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
22699