@tgsnake/skema
    Preparing search index...

    Function bufferToBigint

    • Decodes a Node.js Buffer back into a JS native BigInt value.

      Parameters

      • buffer: Buffer

        The source Buffer containing binary representation of the integer.

      • little: boolean = true

        Set to true if the buffer is encoded in little-endian format; set to false if big-endian. Defaults to true.

      • signed: boolean = false

        Set to true if the buffer contains a signed two's complement integer. Defaults to false.

      Returns bigint

      A standard native bigint value decoded from the bytes.

      const val = bufferToBigint(Buffer.from([0x2a, 0x00]), true, false); // 42n