generateRandomIV static method

InitialisationVector generateRandomIV(
  1. int length
)

Generates a random initialisation vector from a given length Length must be 0 to 16

Implementation

static InitialisationVector generateRandomIV(int length) {
  final iv = IV.fromSecureRandom(length);
  return InitialisationVector(iv.bytes);
}