• Convert a little-endian buffer to signed BigInt using two's complement.

    Parameters

    • buffer: Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

      Little-endian byte buffer

    Returns bigint

    BigInt value (can be negative)

    const buffer = new Uint8Array([0xff, 0xff]); // -1 in 2 bytes
    const num = toBigIntLESigned(buffer); // -1n