generateRandom static method

BuBytes generateRandom({
  1. int length = 32,
})

This function generates a random List<int> of the specified size (default is 32 bytes).

Implementation

static BuBytes generateRandom({int length = 32}) {
  /// Generate the random bytes of the specified size using the _randomGenerator.
  final r = _generateRandom(length);
  assert(r.length == length, "Incorrect random generted size.");

  /// Return the generated random bytes.
  return r;
}