Convert a little-endian buffer to signed BigInt using two's complement.
Little-endian byte buffer
BigInt value (can be negative)
const buffer = new Uint8Array([0xff, 0xff]); // -1 in 2 bytesconst num = toBigIntLESigned(buffer); // -1n Copy
const buffer = new Uint8Array([0xff, 0xff]); // -1 in 2 bytesconst num = toBigIntLESigned(buffer); // -1n
Convert a little-endian buffer to signed BigInt using two's complement.