Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

  • new u128Safe(lo?: number, hi?: number): u128Safe
  • 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 u128Safe

Properties

hi: number = 0
lo: number = 0

Accessors

  • Returns u128Safe

  • Returns u128Safe

  • Returns u128Safe

  • Returns u128Safe

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 u128Safe

    128-bit unsigned integer

  • isZero(): bool
  • Returns bool

  • Returns u128

  • Returns u128

  • Returns u128

  • Returns u128Safe

  • Returns u128Safe

  • Returns u128Safe

  • Returns u128Safe

  • Parameters

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

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

    Returns u128Safe

    128-bit unsigned integer

  • 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 u128Safe

    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

  • 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 u128Safe

  • Parameters

    Returns bool

  • Create 128-bit unsigned integer from generic type T

    Type Parameters

    • T

    Parameters

    • value: T

    Returns u128Safe

    128-bit unsigned integer

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

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

    Returns u128Safe

  • Parameters

    • value: bool

    Returns u128Safe

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

    • T

    Parameters

    • array: T
    • bigEndian: bool = false

    Returns u128Safe

  • Parameters

    • array: number[]

    Returns u128Safe

  • Parameters

    • array: number[]

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

  • Parameters

    • value: i128

    Returns u128Safe

  • Parameters

    • value: i128

    Returns u128Safe

  • Parameters

    • value: i256

    Returns u128Safe

  • Parameters

    • value: i256

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

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

    • value: string
    • radix: number = 10

    Returns u128Safe

  • Parameters

    • value: u256

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

  • Parameters

    • value: number

    Returns u128Safe

  • fromUint8ArrayBE(array: Uint8Array): u128Safe
  • Parameters

    • array: Uint8Array

    Returns u128Safe

  • fromUint8ArrayLE(array: Uint8Array): u128Safe
  • Parameters

    • array: Uint8Array

    Returns u128Safe

  • Parameters

    Returns bool

  • Parameters

    Returns bool

  • isEmpty(value: u128): bool
  • Parameters

    Returns bool

  • Parameters

    Returns bool

  • Parameters

    Returns bool

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

    Parameters

    Returns u128Safe

    128-bit unsigned integer

  • Parameters

    Returns bool

  • 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

    Returns u128Safe

    128-bit unsigned integer

  • Parameters

    Returns u128Safe

  • Parameters

    Returns u128Safe

  • Parameters

    Returns u128Safe

  • Parameters

    Returns u128Safe

  • Parameters

    Returns u128Safe

  • Parameters

    Returns u128Safe

  • Calculate squared value (value ** 2)

    Parameters

    • value: u128

      128-bit unsigned integer

    Returns u128

    128-bit unsigned integer

  • Parameters

    Returns u128Safe

Generated using TypeDoc