toBase32Bytes function
Uint8List
toBase32Bytes(
- List<
int> input, { - Base32Codec? codec,
- bool lower = false,
- bool padding = true,
Converts 8-bit integer sequence to Base-32 and returns the ASCII bytes.
This is the same as toBase32 but returns the encoded characters as a Uint8List of ASCII codes, skipping the intermediate String.
Parameters:
inputis a sequence of 8-bit integers- If
loweris true, the Base32Codec.lowercase alphabet is used. - If
paddingis true, the output will have padding characters. codecis the Base32Codec to use. It is derived from the other parameters if not provided.
Implementation
Uint8List toBase32Bytes(
List<int> input, {
Base32Codec? codec,
bool lower = false,
bool padding = true,
}) {
codec ??= _codecFromParameters(
lower: lower,
padding: padding,
);
Uint8List out = codec.encoder.convert(input);
if (!padding && _codecsWithPadding.contains(codec)) {
out = Uint8List.fromList(
out.takeWhile((x) => x != codec!.encoder.padding).toList(),
);
}
return out;
}