E.g.: binStringToBin('0010101001100100') → new Uint8Array([42, 100])
Note, this method always completes. If binaryDigits is not divisible by 8,
the final byte will be parsed as if it were prepended with 0s (e.g. 1
is interpreted as 00000001). If binaryDigits is potentially malformed,
check it with isBinString before calling this method.
Decode a binary-encoded string into a Uint8Array.
E.g.:
binStringToBin('0010101001100100')→new Uint8Array([42, 100])Note, this method always completes. If
binaryDigitsis not divisible by 8, the final byte will be parsed as if it were prepended with0s (e.g.1is interpreted as00000001). IfbinaryDigitsis potentially malformed, check it withisBinStringbefore calling this method.For the reverse, see binToBinString.