bireader 1.0.53 → 1.0.55

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/lib/esm/index.mjs CHANGED
@@ -734,7 +734,7 @@ function fNumber(_this, targetNumber, bits, unsigned, endian) {
734
734
  }
735
735
  }
736
736
  if (value === targetNumber) {
737
- return z; // Found the byte, return the index
737
+ return z - _this.offset; // Found the byte, return the index from current
738
738
  }
739
739
  }
740
740
  return -1; // number not found
@@ -1251,7 +1251,6 @@ function rint64(_this, unsigned, endian) {
1251
1251
  if ((endian == undefined ? _this.endian : endian) == "little") {
1252
1252
  for (let i = 0; i < 8; i++) {
1253
1253
  value = value | BigInt(_this.data[_this.offset]) << BigInt(8 * i);
1254
- _this.offset += 1;
1255
1254
  }
1256
1255
  if (unsigned == undefined || unsigned == false) {
1257
1256
  if (value & (BigInt(1) << BigInt(63))) {
@@ -1262,7 +1261,6 @@ function rint64(_this, unsigned, endian) {
1262
1261
  else {
1263
1262
  for (let i = 0; i < 8; i++) {
1264
1263
  value = (value << BigInt(8)) | BigInt(_this.data[_this.offset]);
1265
- _this.offset += 1;
1266
1264
  }
1267
1265
  if (unsigned == undefined || unsigned == false) {
1268
1266
  if (value & (BigInt(1) << BigInt(63))) {