Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BigUnsignedIntType

A type storing an arbitrary precision unsigned integer. Each written value has its own number of bytes of precision.

Example:

let type = new sb.BigUnsignedIntType

Hierarchy

  • UnsignedType<bigint>
    • BigUnsignedIntType

Index

Constructors

constructor

Accessors

Static _value

  • get _value(): number

Methods

addToBuffer

consumeValue

  • consumeValue(buffer: ArrayBuffer, offset: number): ReadResult<bigint>
  • Parameters

    • buffer: ArrayBuffer
    • offset: number

    Returns ReadResult<bigint>

equals

  • equals(otherType: unknown): boolean
  • Parameters

    • otherType: unknown

    Returns boolean

getHash

  • getHash(): string

getSignature

  • getSignature(): string

Private isBuffer

Private isSameType

  • Determines whether the input is a Type with the same class

    Parameters

    • otherType: unknown

      A value, usually a Type instance

    Returns otherType is BigUnsignedIntType

    whether this and otherType are instances of the same Type class

readValue

  • readValue(valueBuffer: ArrayBuffer | Uint8Array, offset?: number): bigint
  • Parameters

    • valueBuffer: ArrayBuffer | Uint8Array
    • offset: number = 0

    Returns bigint

toBuffer

  • toBuffer(): ArrayBuffer

valueBuffer

  • valueBuffer(value: bigint): ArrayBuffer
  • Parameters

    • value: bigint

    Returns ArrayBuffer

writeValue

  • Appends value bytes to an AppendableBuffer according to the type

    Examples:

    type.writeValue(buffer, 1n) //takes up 2 bytes
    

    or

    type.writeValue(buffer, 12345678901234567890n) //takes up 9 bytes
    
    throws

    If the value doesn't match the type, e.g. new sb.StringType().writeValue(buffer, 23)

    Parameters

    • buffer: AppendableBuffer

      The buffer to which to append

    • value: bigint

      The value to write

    Returns void

Generated using TypeDoc