toOctal function
Converts 8-bit integer sequence to 3-bit Base-8 character sequence.
Parameters:
input
is a sequence of 8-bit integers.codec
is the Base8Codec to use. Default: Base8Codec.standard.
NOTE:, This implementation is a bit-wise encoding of the input bytes.
To get the numeric representation of the input
in binary:
toBigInt(input).toRadixString(8)
Implementation
String toOctal(
List<int> input, {
Base8Codec codec = Base8Codec.standard,
}) {
var out = codec.encoder.convert(input);
return String.fromCharCodes(out);
}