@typeberry/convert 0.7.3-a9aeaa5 → 0.7.3-ffe481c

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/index.js CHANGED
@@ -4666,7 +4666,7 @@ function seeThrough(v) {
4666
4666
  }
4667
4667
 
4668
4668
  ;// CONCATENATED MODULE: ./packages/core/utils/package.json
4669
- const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"0.7.3-a9aeaa5"}');
4669
+ const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"0.7.3-ffe481c"}');
4670
4670
  ;// CONCATENATED MODULE: ./packages/core/utils/result.ts
4671
4671
 
4672
4672
  /**
@@ -5481,7 +5481,8 @@ function numbers_u32AsLeBytes(value) {
5481
5481
  */
5482
5482
  function leBytesAsU32(uint8Array) {
5483
5483
  check `${uint8Array.length === 4} Input must be a Uint8Array of length 4`;
5484
- return asTypedNumber(uint8Array[0] | (uint8Array[1] << 8) | (uint8Array[2] << 16) | (uint8Array[3] << 24));
5484
+ // >>> 0 is needed to avoid changing sign of the number (the `<< 24` produces a signed int32)
5485
+ return asTypedNumber((uint8Array[0] | (uint8Array[1] << 8) | (uint8Array[2] << 16) | (uint8Array[3] << 24)) >>> 0);
5485
5486
  }
5486
5487
  /** Get the smallest value between U64 a and values given as input parameters. */
5487
5488
  const minU64 = (a, ...values) => values.reduce((min, value) => (value > min ? min : value), a);
@@ -17409,7 +17410,8 @@ function memory_utils_getPageNumber(address) {
17409
17410
  return page_utils_tryAsPageNumber(address >>> memory_consts_PAGE_SIZE_SHIFT);
17410
17411
  }
17411
17412
  function memory_utils_getStartPageIndex(address) {
17412
- return memory_index_tryAsMemoryIndex((address >>> memory_consts_PAGE_SIZE_SHIFT) << memory_consts_PAGE_SIZE_SHIFT);
17413
+ // >>> 0 is needed to avoid changing sign of the number
17414
+ return memory_index_tryAsMemoryIndex(((address >>> memory_consts_PAGE_SIZE_SHIFT) << memory_consts_PAGE_SIZE_SHIFT) >>> 0);
17413
17415
  }
17414
17416
  function getStartPageIndexFromPageNumber(pageNumber) {
17415
17417
  // >>> 0 is needed to avoid changing sign of the number