bson 6.5.0 → 6.5.1

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/bson.mjs CHANGED
@@ -2155,9 +2155,15 @@ const NumberUtils = {
2155
2155
  source[offset] * 16777216);
2156
2156
  },
2157
2157
  getBigInt64LE(source, offset) {
2158
- const lo = NumberUtils.getUint32LE(source, offset);
2159
- const hi = NumberUtils.getUint32LE(source, offset + 4);
2160
- return (BigInt(hi) << BigInt(32)) + BigInt(lo);
2158
+ const hi = BigInt(source[offset + 4] +
2159
+ source[offset + 5] * 256 +
2160
+ source[offset + 6] * 65536 +
2161
+ (source[offset + 7] << 24));
2162
+ const lo = BigInt(source[offset] +
2163
+ source[offset + 1] * 256 +
2164
+ source[offset + 2] * 65536 +
2165
+ source[offset + 3] * 16777216);
2166
+ return (hi << BigInt(32)) + lo;
2161
2167
  },
2162
2168
  getFloat64LE: isBigEndian
2163
2169
  ? (source, offset) => {