node-dextrin - v0.4.0
    Preparing search index...

    Class export=

    DXN bits (DXN.md §1.4): a run of bits that is not whole bytes -- @bits {"oA==" 3} in text, T_BITS around [bytes, count] in .dxnb. JavaScript has no bitstring, so this holds the bytes, the unused low bits of the last one zero, and how many bits are the value.

    Bits and bytes are one value space: a run of whole bytes is bytes, so DXNBits.from answers a DXNBytes for one, and the constructor refuses it. Mirrors the Elixir reference's bitstring in a Dextrin.Bytes.

    Index
    • Parameters

      • data: Uint8Array<ArrayBufferLike>

        the bits, from the high bit of the first byte

      • bitLength: number

        how many of them are the value; not a multiple of 8

      Returns export=

    bitLength: number
    data: Uint8Array<ArrayBufferLike>
    dxnType: string
    • Parameters

      • other: unknown

      Returns -1 | 0 | 1

    • The value data and bitLength write: bits, or bytes when the count is a whole number of them. Throws a TypeError when they write none (a count the data does not match).

      Parameters

      • data: Uint8Array<ArrayBufferLike>
      • bitLength: number | bigint

      Returns export= | export=

    • data with the unused low bits of its last byte cleared, or null when it is not exactly the bytes bitLength needs.

      Parameters

      • data: Uint8Array<ArrayBufferLike>
      • bitLength: number

      Returns Uint8Array<ArrayBufferLike> | null