fromBinary function
Converts 2-bit Base-2 character sequence to 8-bit integer sequence.
Parameters:
input
should be a valid binary/base-2 encoded string.codec
is the Base2Codec to use. Default: Base2Codec.standard.
Throws:
- FormatException if the
input
contains invalid characters.
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);
}