bireader 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/reader.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bireader",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Read and write data in binary",
5
5
  "main": "index.js",
6
6
  "directories": {
package/src/reader.js CHANGED
@@ -2647,9 +2647,9 @@ class bireader {
2647
2647
  this.#check_size(4)
2648
2648
  var read;
2649
2649
  if((endian != undefined ? endian : this.endian) == "little"){
2650
- read = ((this.#flip(this.data[this.offset + 3]) << 24) | (this.#flip(this.data[this.offset + 2]) << 16) | (this.#flip(this.data[this.offset + 1]) << 8) | this.#flip(this.data[this.offset]))
2650
+ read = (((this.data[this.offset + 3] & 0xFF)<< 24) | ((this.data[this.offset + 2] & 0xFF) << 16) | ((this.data[this.offset + 1] & 0xFF) << 8) | (this.data[this.offset] & 0xFF))
2651
2651
  } else {
2652
- read = (this.#flip(this.data[this.offset]) << 24) | (this.#flip(this.data[this.offset + 1]) << 16) | (this.#flip(this.data[this.offset + 2]) << 8) | this.#flip(this.data[this.offset + 3])
2652
+ read = ((this.data[this.offset] & 0xFF) << 24) | ((this.data[this.offset + 1] & 0xFF) << 16) | ((this.data[this.offset + 2] & 0xFF) << 8) | (this.data[this.offset + 3] & 0xFF)
2653
2653
  }
2654
2654
  this.offset += 4
2655
2655
  if(unsigned == undefined || unsigned == false){