pad method
Implementation
Uint8List pad(int blockSize, Iterable<int> input) {
if (blockSize > 255) {
throw Exception('PKCS #7 only supports block sizes less than 256');
}
int numBlocks = (input.length + blockSize) ~/ blockSize;
int outSize = numBlocks * blockSize;
final ret = Uint8List(outSize);
ret.setAll(0, input);
for (int i = input.length; i < outSize; i++) {
ret[i] = outSize - input.length;
}
return ret;
}