Class BitBuilder

Class for building bit strings

Hierarchy

  • BitBuilder

Constructors

  • Parameters

    • Optional size: number

    Returns BitBuilder

Properties

_buffer: any
_length: any

Accessors

  • get length(): number
  • Current number of bits written

    Returns number

Methods

  • Build into Buffer

    Returns

    result buffer

    Returns Buffer

  • Build BitString

    Returns

    result bit string

    Returns BitString

  • Write address

    Parameters

    Returns void

  • Write a single bit

    Parameters

    • value: number | boolean

      bit to write, true or positive number for 1, false or zero or negative for 0

    Returns void

  • Copy bits from BitString

    Parameters

    Returns void

  • Write bits from buffer

    Parameters

    • src: Buffer

      source buffer

    Returns void

  • Write coins in var uint format

    Parameters

    • amount: number | bigint

      amount to write

    Returns void

  • Write int value

    Parameters

    • value: number | bigint

      value as bigint or number

    • bits: number

      number of bits to write

    Returns void

  • Write uint value

    Parameters

    • value: number | bigint

      value as bigint or number

    • bits: number

      number of bits to write

    Returns void

  • Wrtie var int value, used for serializing coins

    Parameters

    • value: number | bigint

      value to write as bigint or number

    • bits: number

      header bits to write size

    Returns void

  • Wrtie var uint value, used for serializing coins

    Parameters

    • value: number | bigint

      value to write as bigint or number

    • bits: number

      header bits to write size

    Returns void

Generated using TypeDoc