bson 6.8.0 → 6.8.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.cjs CHANGED
@@ -2231,9 +2231,15 @@ const NumberUtils = {
2231
2231
  source[offset] * 16777216);
2232
2232
  },
2233
2233
  getBigInt64LE(source, offset) {
2234
- const lo = NumberUtils.getUint32LE(source, offset);
2235
- const hi = NumberUtils.getUint32LE(source, offset + 4);
2236
- return (BigInt(hi) << BigInt(32)) + BigInt(lo);
2234
+ const hi = BigInt(source[offset + 4] +
2235
+ source[offset + 5] * 256 +
2236
+ source[offset + 6] * 65536 +
2237
+ (source[offset + 7] << 24));
2238
+ const lo = BigInt(source[offset] +
2239
+ source[offset + 1] * 256 +
2240
+ source[offset + 2] * 65536 +
2241
+ source[offset + 3] * 16777216);
2242
+ return (hi << BigInt(32)) + lo;
2237
2243
  },
2238
2244
  getFloat64LE: isBigEndian
2239
2245
  ? (source, offset) => {