pad method
Implementation
Uint8List pad(int blockSize, Iterable<int> input) {
int numBlocks = (input.length / (blockSize - 11)).ceil();
final output = Uint8List(numBlocks * blockSize);
for (int i = 0; i < numBlocks; i++) {
Iterable<int> block;
if (i == numBlocks - 1) {
block = input;
} else {
block = input.take(blockSize - 11);
input = input.skip(blockSize - 11);
}
padBlock(
blockSize, block, output.buffer.asByteData(i * blockSize, blockSize));
}
return output;
}