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