@tgsnake/skema
    Preparing search index...

    Class Int256

    tgsnake - Telegram MTProto library for javascript or typescript. Copyright (C) 2025 tgsnake https://github.com/tgsnake

    THIS FILE IS PART OF TGSNAKE

    tgsnake is a free software: you can redistribute it and/or modify it under the terms of the MIT License as published.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _slots: string[]

    Internal array of slot names for the object.

    className: string

    Name of the class.

    classType: string

    Type of the class.

    cls: any = ...

    Reference to the constructor of the current class (late static binding).

    constructorId: number

    Unique identifier for the constructor.

    subclassOfId: number

    Identifier for the parent class (if any).

    SIZE: number = 32

    Methods

    • Reads data from the provided BytesIO instance and processes it using the associated class's read method.

      Parameters

      • data: BytesIO

        The BytesIO instance containing the data to be read.

      • ...args: any[]

        Additional arguments to be passed to the class's read method.

      Returns Promise<any>

      A promise that resolves with the result of the read operation.

    • Serializes the provided arguments using the associated class's write method.

      Parameters

      • ...args: any[]

        The arguments to be serialized.

      Returns Buffer

      The resulting Buffer after serialization.

    • Reads an integer value from the provided BytesIO stream.

      Parameters

      • data: BytesIO

        The byte stream to read from.

      • signed: boolean = true

        Whether the integer should be interpreted as signed. Defaults to true.

      • little: boolean = true

        Whether the byte order is little-endian. Defaults to true.

      • size: number = Int256.SIZE

        The number of bytes to read. Defaults to Int256.SIZE.

      Returns Promise<bigint>

      A promise that resolves to the read integer as a bigint.

    • Serializes a bigint value into a Buffer, representing a 256-bit integer.

      Parameters

      • value: bigint

        The bigint value to serialize.

      • _signed: boolean = true

        Indicates whether the integer is signed. Defaults to true.

      • _little: boolean = true

        Indicates whether to use little-endian byte order. Defaults to true.

      Returns Buffer

      A Buffer containing the serialized bytes of the bigint value.