whiteflag-js
    Preparing search index...

    Function cropBits

    • Function

      Shortens a Uint8Array to the length of the specified bits cropBits

      Parameters

      • u8array: Uint8Array

        the Uint8Array containing the bitset

      • nBits: number

        the number of used bits, or, if negative, the number of bits to remove

      Returns Uint8Array

      a new Uint8Array with the unused bits cleared