bson 6.6.0 → 6.6.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
@@ -2166,9 +2166,15 @@ const NumberUtils = {
2166
2166
  source[offset] * 16777216);
2167
2167
  },
2168
2168
  getBigInt64LE(source, offset) {
2169
- const lo = NumberUtils.getUint32LE(source, offset);
2170
- const hi = NumberUtils.getUint32LE(source, offset + 4);
2171
- return (BigInt(hi) << BigInt(32)) + BigInt(lo);
2169
+ const hi = BigInt(source[offset + 4] +
2170
+ source[offset + 5] * 256 +
2171
+ source[offset + 6] * 65536 +
2172
+ (source[offset + 7] << 24));
2173
+ const lo = BigInt(source[offset] +
2174
+ source[offset + 1] * 256 +
2175
+ source[offset + 2] * 65536 +
2176
+ source[offset + 3] * 16777216);
2177
+ return (hi << BigInt(32)) + lo;
2172
2178
  },
2173
2179
  getFloat64LE: isBigEndian
2174
2180
  ? (source, offset) => {