node-opcua-utils 2.85.0 → 2.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
CHANGED
package/dist/buffer_ellipsis.js
CHANGED
|
@@ -8,9 +8,9 @@ function buffer_ellipsis(buffer, start, end) {
|
|
|
8
8
|
start = start || 0;
|
|
9
9
|
end = end || buffer.length;
|
|
10
10
|
if (end - start < 40) {
|
|
11
|
-
return buffer.
|
|
11
|
+
return buffer.subarray(start, end).toString("hex");
|
|
12
12
|
}
|
|
13
|
-
return buffer.
|
|
13
|
+
return buffer.subarray(start, start + 10).toString("hex") + " ... " + buffer.subarray(end - 10, end).toString("hex");
|
|
14
14
|
}
|
|
15
15
|
exports.buffer_ellipsis = buffer_ellipsis;
|
|
16
16
|
exports.buffer_ellipsis = buffer_ellipsis;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_ellipsis.js","sourceRoot":"","sources":["../source/buffer_ellipsis.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,eAAe,CAAC,MAAc,EAAE,KAAc,EAAE,GAAY;IACxE,KAAK,GAAG,KAAK,IAAI,CAAC,CAAC;IACnB,GAAG,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC;IAC3B,IAAI,GAAG,GAAG,KAAK,GAAG,EAAE,EAAE;QAClB,OAAO,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"buffer_ellipsis.js","sourceRoot":"","sources":["../source/buffer_ellipsis.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,eAAe,CAAC,MAAc,EAAE,KAAc,EAAE,GAAY;IACxE,KAAK,GAAG,KAAK,IAAI,CAAC,CAAC;IACnB,GAAG,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC;IAC3B,IAAI,GAAG,GAAG,KAAK,GAAG,EAAE,EAAE;QAClB,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;KACtD;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzH,CAAC;AAPD,0CAOC;AAED,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC"}
|
package/dist/compare_buffers.js
CHANGED
|
@@ -12,8 +12,8 @@ function compare_buffers(buf1, buf2, max_length) {
|
|
|
12
12
|
const block_length = 80;
|
|
13
13
|
let cursor = 0;
|
|
14
14
|
while (cursor < max_length) {
|
|
15
|
-
const slice1 = buf1.
|
|
16
|
-
const slice2 = buf2.
|
|
15
|
+
const slice1 = buf1.subarray(cursor, cursor + block_length);
|
|
16
|
+
const slice2 = buf2.subarray(cursor, cursor + block_length);
|
|
17
17
|
if (slice2.toString("hex") !== slice1.toString("hex")) {
|
|
18
18
|
console.log("pos = ", cursor);
|
|
19
19
|
console.log("slice1 :", chalk.yellow((0, buffer_ellipsis_1.buffer_ellipsis)(slice1)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare_buffers.js","sourceRoot":"","sources":["../source/compare_buffers.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,4BAA4B;AAC5B,+BAA+B;AAC/B,uDAAoD;AAEpD,SAAgB,eAAe,CAAC,IAAY,EAAE,IAAY,EAAE,UAAmB;IAC3E,UAAU,GAAG,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC;IACvC,MAAM,YAAY,GAAG,EAAE,CAAC;IACxB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,OAAO,MAAM,GAAG,UAAU,EAAE;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"compare_buffers.js","sourceRoot":"","sources":["../source/compare_buffers.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,4BAA4B;AAC5B,+BAA+B;AAC/B,uDAAoD;AAEpD,SAAgB,eAAe,CAAC,IAAY,EAAE,IAAY,EAAE,UAAmB;IAC3E,UAAU,GAAG,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC;IACvC,MAAM,YAAY,GAAG,EAAE,CAAC;IACxB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,OAAO,MAAM,GAAG,UAAU,EAAE;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC;QAC5D,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACnD,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,IAAA,iCAAe,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC/D,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,IAAA,iCAAe,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SAChE;QACD,MAAM,IAAI,YAAY,CAAC;KAC1B;IACD,2CAA2C;AAC/C,CAAC;AAfD,0CAeC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.88.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -utils",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"chalk": "4.1.2",
|
|
16
|
-
"node-opcua-assert": "2.
|
|
16
|
+
"node-opcua-assert": "2.88.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"should": "^13.2.3",
|
|
20
|
-
"sinon": "^
|
|
20
|
+
"sinon": "^15.0.1"
|
|
21
21
|
},
|
|
22
22
|
"author": "Etienne Rossignon",
|
|
23
23
|
"license": "MIT",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"internet of things"
|
|
35
35
|
],
|
|
36
36
|
"homepage": "http://node-opcua.github.io/",
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "0c20078b474f36855b799557f8fe931dbe20c2ca"
|
|
38
38
|
}
|
|
@@ -5,9 +5,9 @@ export function buffer_ellipsis(buffer: Buffer, start?: number, end?: number): s
|
|
|
5
5
|
start = start || 0;
|
|
6
6
|
end = end || buffer.length;
|
|
7
7
|
if (end - start < 40) {
|
|
8
|
-
return buffer.
|
|
8
|
+
return buffer.subarray(start, end).toString("hex");
|
|
9
9
|
}
|
|
10
|
-
return buffer.
|
|
10
|
+
return buffer.subarray(start, start + 10).toString("hex") + " ... " + buffer.subarray(end - 10, end).toString("hex");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
exports.buffer_ellipsis = buffer_ellipsis;
|
|
@@ -10,8 +10,8 @@ export function compare_buffers(buf1: Buffer, buf2: Buffer, max_length?: number)
|
|
|
10
10
|
const block_length = 80;
|
|
11
11
|
let cursor = 0;
|
|
12
12
|
while (cursor < max_length) {
|
|
13
|
-
const slice1 = buf1.
|
|
14
|
-
const slice2 = buf2.
|
|
13
|
+
const slice1 = buf1.subarray(cursor, cursor + block_length);
|
|
14
|
+
const slice2 = buf2.subarray(cursor, cursor + block_length);
|
|
15
15
|
if (slice2.toString("hex") !== slice1.toString("hex")) {
|
|
16
16
|
console.log("pos = ", cursor);
|
|
17
17
|
console.log("slice1 :", chalk.yellow(buffer_ellipsis(slice1)));
|