fromBinary function

Uint8List fromBinary(
  1. String input, {
  2. Base2Codec codec = Base2Codec.standard,
})

Converts 2-bit Base-2 character sequence to 8-bit integer sequence.

Parameters:

Throws:

If a partial string is detected, the following bits are assumed to be zeros.

NOTE:, This implementation is a bit-wise decoding of the input bytes. To get the bytes from the numeric representation of the input:

fromBigInt(BigInt.parse(input, radix: 2));

Implementation

Uint8List fromBinary(
  String input, {
  Base2Codec codec = Base2Codec.standard,
}) {
  return codec.decoder.convert(input.codeUnits);
}