pad static method

Uint8List pad(
  1. Uint8List bytes,
  2. int blockSizeBytes
)

Implementation

static Uint8List pad(Uint8List bytes, int blockSizeBytes) {
  final padLength = blockSizeBytes - (bytes.length % blockSizeBytes);
  final padded = Uint8List(bytes.length + padLength)..setAll(0, bytes);
  Padding('PKCS7').addPadding(padded, bytes.length);
  return padded;
}