toBase32 function
Converts 8-bit integer sequence to 5-bit Base-32 character sequence.
Parameters:
input
is a sequence of 8-bit integers- If
lower
is true, the Base32Codec.lowercase alphabet is used. - If
padding
is true, the output will not have padding characters. codec
is the Base32Codec to use. It is derived from the other parameters if not provided.
Implementation
String toBase32(
List<int> input, {
Base32Codec? codec,
bool lower = false,
bool padding = true,
}) {
codec ??= _codecFromParameters(
lower: lower,
padding: padding,
);
Iterable<int> out = codec.encoder.convert(input);
if (!padding && _codecsWithPadding.contains(codec)) {
out = out.takeWhile((x) => x != codec!.encoder.padding);
}
return String.fromCharCodes(out);
}