Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

  • new u128(lo?: number, hi?: number): u128
  • Create 128-bit unsigned integer from 64-bit parts

    Parameters

    • lo: number = 0

      low 64-bit part of 128-bit unsigned integer

    • hi: number = 0

      high 64-bit part of 128-bit unsigned integer

    Returns u128

Properties

hi: number = 0
lo: number = 0

Accessors

  • Returns u128

  • Returns u128

  • Returns u128

  • Returns u128

Methods

  • as<T>(): T
  • Convert to generic type T. Useful inside other generics methods

    Type Parameters

    • T

    Returns T

    type of T

  • Return copy of current 128-bit value

    Returns u128

    128-bit unsigned integer

  • isZero(): bool
  • Returns bool

  • Returns u128

  • Returns u128

  • Returns u128

  • Returns u128

  • Returns u128

  • Returns u128

  • Returns u128

  • Parameters

    Returns u128

  • setI32(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • setI64(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • setU32(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • setU64(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • Calculate inplace squared 128-bit unsigned integer (this ** 2)

    Returns u128

    128-bit unsigned integer

  • toArrayBuffer(buffer: number, bigEndian?: bool): void
  • Parameters

    • buffer: number
    • bigEndian: bool = false

    Returns void

  • toArrayBufferBE(buffer: number): void
  • Parameters

    • buffer: number

    Returns void

  • toArrayBufferLE(buffer: number): void
  • Parameters

    • buffer: number

    Returns void

  • toBool(): bool
  • Convert to 1-bit boolean

    Returns bool

    1-bit boolean

  • toBytes(bigEndian?: bool): number[]
  • Convert to byte array

    Parameters

    • bigEndian: bool = false

      Little or Big Endian? Default: false

    Returns number[]

    Array of bytes

  • toF32(): number
  • Convert to 32-bit float number

    Returns number

    32-bit float

  • toF64(): number
  • Convert to 64-bit float number in deteministic way

    Returns number

    64-bit float

  • toI128(): i128
  • Convert to 128-bit signed integer

    Returns i128

    128-bit signed integer

  • toI256(): i256
  • Convert to 256-bit signed integer

    Returns i256

    256-bit signed integer

  • toI32(): number
  • Convert to 32-bit signed integer

    Returns number

    32-bit signed integer

  • toI64(): number
  • Convert to 64-bit signed integer

    Returns number

    64-bit signed integer

  • toStaticBytes(bigEndian?: bool): StaticArray<number>
  • Convert to byte static array

    Parameters

    • bigEndian: bool = false

      Little or Big Endian? Default: false

    Returns StaticArray<number>

    StaticArray of bytes

  • toString(radix?: number): string
  • Parameters

    • radix: number = 10

    Returns string

  • Convert to 128-bit unsigned integer

    Returns u128

    128-bit unsigned integer

  • toU256(): u256
  • Convert to 256-bit unsigned integer

    Returns u256

    256-bit unsigned integer

  • toU32(): number
  • Convert to 32-bit unsigned integer

    Returns number

    32-bit unsigned integer

  • toU64(): number
  • Convert to 64-bit unsigned integer

    Returns number

    64-bit unsigned integer

  • toUint8Array(bigEndian?: bool): Uint8Array
  • Convert to Uint8Array

    Parameters

    • bigEndian: bool = false

      Little or Big Endian? Default: false

    Returns Uint8Array

    Uint8Array

  • Parameters

    Returns u128

  • Parameters

    Returns u128

  • clz(value: u128): number
  • Compute bit count of leading zeros

    Parameters

    • value: u128

      128-bit unsigned integer

    Returns number

    32-bit signed integer

  • ctz(value: u128): number
  • Compute bit count of trailing zeros

    Parameters

    • value: u128

      128-bit unsigned integer

    Returns number

    32-bit signed integer

  • Parameters

    Returns u128

  • Parameters

    Returns u128

  • Parameters

    Returns bool

  • from<T>(value: T): u128
  • Create 128-bit unsigned integer from generic type T

    Type Parameters

    • T

    Parameters

    • value: T

    Returns u128

    128-bit unsigned integer

  • fromBits(lo1: number, lo2: number, hi1: number, hi2: number): u128
  • Parameters

    • lo1: number
    • lo2: number
    • hi1: number
    • hi2: number

    Returns u128

  • fromBool(value: bool): u128
  • Parameters

    • value: bool

    Returns u128

  • fromBytes<T>(array: T, bigEndian?: bool): u128
  • Type Parameters

    • T

    Parameters

    • array: T
    • bigEndian: bool = false

    Returns u128

  • fromBytesBE(array: number[]): u128
  • Parameters

    • array: number[]

    Returns u128

  • fromBytesLE(array: number[]): u128
  • Parameters

    • array: number[]

    Returns u128

  • fromF32(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • fromF64(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • fromI128(value: i128): u128
  • Parameters

    • value: i128

    Returns u128

  • fromI256(value: i256): u128
  • Parameters

    • value: i256

    Returns u128

  • fromI32(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • fromI64(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • fromString(value: string, radix?: number): u128
  • Parameters

    • value: string
    • radix: number = 10

    Returns u128

  • Parameters

    Returns u128

  • fromU256(value: u256): u128
  • Parameters

    • value: u256

    Returns u128

  • fromU32(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • fromU64(value: number): u128
  • Parameters

    • value: number

    Returns u128

  • fromUint8ArrayBE(array: Uint8Array): u128
  • Parameters

    • array: Uint8Array

    Returns u128

  • fromUint8ArrayLE(array: Uint8Array): u128
  • Parameters

    • array: Uint8Array

    Returns u128

  • Parameters

    Returns bool

  • Parameters

    Returns bool

  • isEmpty(value: u128): bool
  • Parameters

    Returns bool

  • Parameters

    Returns bool

  • Parameters

    Returns bool

  • Parameters

    Returns u128

  • Calculate multiply and division as number * numerator / denominator without overflow in multiplication part.

    Parameters

    Returns u128

    128-bit unsigned integer

  • Parameters

    Returns bool

  • Parameters

    Returns u128

  • Get ordering if a > b then result is 1 if a < b then result is -1 if a = b then result is 0

    Parameters

    • a: u128

      128-bit unsigned integer

    • b: u128

      128-bit unsigned integer

    Returns number

    32-bit signed integer

  • popcnt(value: u128): number
  • Compute count of set (populated) bits

    Parameters

    • value: u128

      128-bit unsigned integer

    Returns number

    32-bit signed integer

  • Calculate power of base with exponent

    Parameters

    • base: u128

      128-bit unsigned integer

    • exponent: number

      32-bit signed integer

    Returns u128

    128-bit unsigned integer

  • Parameters

    Returns u128

  • Parameters

    Returns u128

  • Parameters

    • value: u128
    • shift: number

    Returns u128

  • Parameters

    • value: u128
    • shift: number

    Returns u128

  • Parameters

    • value: u128
    • shift: number

    Returns u128

  • Parameters

    • value: u128
    • shift: number

    Returns u128

  • Parameters

    • value: u128
    • shift: number

    Returns u128

  • Calculate squared value (value ** 2)

    Parameters

    • value: u128

      128-bit unsigned integer

    Returns u128

    128-bit unsigned integer

  • Parameters

    Returns u128

  • Parameters

    Returns u128

  • Parameters

    Returns u128

Generated using TypeDoc