Optional
allowWhether to allow the use of padding for bin
values where the provided
number of bits cannot be directly mapped to an equivalent result array
(remaining bits are filled with 0
), defaults to true
An array of numbers representing the bits to regroup. Each item must be a
number within the range of sourceWordLength
.
The bit-length of each number in the desired result array, e.g. to regroup
bits into 4-bit numbers, use 4
(must be a positive integer)
The bit-length of each number in bin
, e.g. to regroup bits from a
Uint8Array
, use 8
(must be a positive integer)
Generated using TypeDoc
Given an array of integers, regroup bits from
sourceWordLength
toresultWordLength
, returning a new array of integers between 0 and toWordLength^2.Note, if
bin
is within the range ofsourceWordLength
andpadding
istrue
, this method will never error.A.K.A.
convertbits