Function parseSpecificIntType

  • Parses an integer from a buffer gives the number of bytes, endianness, signedness and offset.

    Parameters

    • buffer: Buffer

      The buffer to read from.

    • bytes: number

      The number of bytes to read.

    • format: "BE" | "LE"

      The endianness of the data.

    • signed: boolean = false

      The signedness of the data. Defaults to false.

    • offset: number = 0

      The offset to read from. Defaults to 0.

    Returns bigint

    The parsed integer.

    If the byte length is less than 1.

    If the buffer does not contain enough data at the specified offset.