From 47ed8d4f435486ec01ce70b3c3fd5a10f7f921a8 Mon Sep 17 00:00:00 2001 From: Danish Arora Date: Mon, 19 May 2025 18:07:35 +0530 Subject: [PATCH] try --- packages/rln/src/utils/bytes.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/rln/src/utils/bytes.ts b/packages/rln/src/utils/bytes.ts index 279a2b3822..6e4f022055 100644 --- a/packages/rln/src/utils/bytes.ts +++ b/packages/rln/src/utils/bytes.ts @@ -61,12 +61,12 @@ export function writeUIntLE( * @param array: Uint8Array * @returns BigInt */ -export function buildBigIntFromUint8Array( - array: Uint8Array, - byteOffset: number = 0 -): bigint { - const dataView = new DataView(array.buffer); - return dataView.getBigUint64(byteOffset, true); +export function buildBigIntFromUint8Array(array: Uint8Array): bigint { + let hex = ""; + for (let i = array.length - 1; i >= 0; i--) { + hex += array[i].toString(16).padStart(2, "0"); + } + return BigInt("0x" + hex); } /**