SofaBuffers TypeScript - v0.11.0
    Preparing search index...

    Class Long

    Index
    • Parameters

      • low: number
      • high: number

      Returns Long

    high: number

    High 32 bits (unsigned).

    low: number

    Low 32 bits (unsigned).

    ZERO: Long = ...

    The 64-bit zero. Long is immutable (readonly halves), so this single shared instance is safe to reuse anywhere a zero default is needed — generated code uses it for fixed-count array defaults and pad-fill instead of Long.fromValue(0), which would run bigint arithmetic per call on the hot decode/encode path.

    • Materialise as a bigint. signed reads the high bit as two's complement.

      Parameters

      • signed: boolean = false

      Returns bigint

    • Decimal string (signed interprets the high bit as two's complement).

      Parameters

      • signed: boolean = false

      Returns string

    • Split a bigint into its low/high 32-bit halves (two's complement). The BigInt64Array store is ToBigInt64 — reduction modulo 2^64 — so an out-of-range value keeps exactly the halves the masks kept (bits64).

      Parameters

      • value: bigint

      Returns Long

    • Construct from raw 32-bit halves.

      Parameters

      • low: number
      • high: number

      Returns Long

    • From an integer number (|n| < 2^53); sign handled via bigint once.

      Parameters

      • n: number

      Returns Long

    • Accept a Long as-is, or convert a bigint / number once.

      Parameters

      • v: number | bigint | Long

      Returns Long