mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-26 17:43:12 +00:00
test
This commit is contained in:
parent
e5a52d0a9c
commit
1cb62babe8
@ -65,16 +65,8 @@ export function buildBigIntFromUint8Array(
|
||||
array: Uint8Array,
|
||||
byteOffset: number = 0
|
||||
): bigint {
|
||||
// Convert byte array to BigInt in big-endian format (to match nwaku)
|
||||
let result = 0n;
|
||||
// Process all 32 bytes (or the available bytes if less)
|
||||
const length = Math.min(array.length - byteOffset, 32);
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
result = (result << 8n) | BigInt(array[byteOffset + i]);
|
||||
}
|
||||
|
||||
return result;
|
||||
const dataView = new DataView(array.buffer);
|
||||
return dataView.getBigUint64(byteOffset, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user