Class BitBuilder

Class for building bit strings

Constructors

Properties

_buffer: Buffer
_length: number

Accessors

Methods

  • 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

  • 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