This commit is contained in:
Danish Arora 2025-05-19 18:07:35 +05:30
parent 6d86b6f011
commit 47ed8d4f43
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E

View File

@ -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);
}
/**