@hamradio/meshcore 1.1.2 → 1.1.3
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/README.md +8 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/packet.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,10 +32,15 @@ _Packet {
|
|
|
32
32
|
routeType: 1,
|
|
33
33
|
payloadVersion: 0,
|
|
34
34
|
payloadType: 1,
|
|
35
|
-
pathHashCount:
|
|
36
|
-
pathHashSize:
|
|
35
|
+
pathHashCount: 10,
|
|
36
|
+
pathHashSize: 1,
|
|
37
37
|
pathHashBytes: 10,
|
|
38
|
-
pathHashes: [
|
|
38
|
+
pathHashes: [
|
|
39
|
+
'a5', '0e', '2c',
|
|
40
|
+
'b0', '33', '6d',
|
|
41
|
+
'b6', '7b', 'bf',
|
|
42
|
+
'78'
|
|
43
|
+
]
|
|
39
44
|
}
|
|
40
45
|
*/
|
|
41
46
|
```
|
package/dist/index.js
CHANGED
|
@@ -626,12 +626,12 @@ var Packet = class _Packet {
|
|
|
626
626
|
this.routeType = header & 3;
|
|
627
627
|
this.payloadVersion = header >> 6 & 3;
|
|
628
628
|
this.payloadType = header >> 2 & 15;
|
|
629
|
-
this.
|
|
630
|
-
this.
|
|
629
|
+
this.pathHashSize = (pathLength >> 6) + 1;
|
|
630
|
+
this.pathHashCount = pathLength & 63;
|
|
631
631
|
this.pathHashBytes = this.pathHashCount * this.pathHashSize;
|
|
632
632
|
this.pathHashes = [];
|
|
633
|
-
for (let i = 0; i < this.
|
|
634
|
-
const hashBytes = this.path.slice(i
|
|
633
|
+
for (let i = 0; i < this.pathHashBytes; i += this.pathHashSize) {
|
|
634
|
+
const hashBytes = this.path.slice(i, i + this.pathHashSize);
|
|
635
635
|
const hashHex = (0, import_utils2.bytesToHex)(hashBytes);
|
|
636
636
|
this.pathHashes.push(hashHex);
|
|
637
637
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -590,12 +590,12 @@ var Packet = class _Packet {
|
|
|
590
590
|
this.routeType = header & 3;
|
|
591
591
|
this.payloadVersion = header >> 6 & 3;
|
|
592
592
|
this.payloadType = header >> 2 & 15;
|
|
593
|
-
this.
|
|
594
|
-
this.
|
|
593
|
+
this.pathHashSize = (pathLength >> 6) + 1;
|
|
594
|
+
this.pathHashCount = pathLength & 63;
|
|
595
595
|
this.pathHashBytes = this.pathHashCount * this.pathHashSize;
|
|
596
596
|
this.pathHashes = [];
|
|
597
|
-
for (let i = 0; i < this.
|
|
598
|
-
const hashBytes = this.path.slice(i
|
|
597
|
+
for (let i = 0; i < this.pathHashBytes; i += this.pathHashSize) {
|
|
598
|
+
const hashBytes = this.path.slice(i, i + this.pathHashSize);
|
|
599
599
|
const hashHex = bytesToHex(hashBytes);
|
|
600
600
|
this.pathHashes.push(hashHex);
|
|
601
601
|
}
|
package/dist/packet.js
CHANGED
|
@@ -11,12 +11,12 @@ export class Packet {
|
|
|
11
11
|
this.routeType = (header) & 0x03;
|
|
12
12
|
this.payloadVersion = (header >> 6) & 0x03;
|
|
13
13
|
this.payloadType = (header >> 2) & 0x0f;
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
14
|
+
this.pathHashSize = (pathLength >> 6) + 1;
|
|
15
|
+
this.pathHashCount = pathLength & 0x3f;
|
|
16
16
|
this.pathHashBytes = this.pathHashCount * this.pathHashSize;
|
|
17
17
|
this.pathHashes = [];
|
|
18
|
-
for (let i = 0; i < this.
|
|
19
|
-
const hashBytes = this.path.slice(i
|
|
18
|
+
for (let i = 0; i < this.pathHashBytes; i += this.pathHashSize) {
|
|
19
|
+
const hashBytes = this.path.slice(i, i + this.pathHashSize);
|
|
20
20
|
const hashHex = bytesToHex(hashBytes);
|
|
21
21
|
this.pathHashes.push(hashHex);
|
|
22
22
|
}
|