generateUniqueRandom static method

List<int> generateUniqueRandom({
  1. int length = 32,
  2. List<List<int>> existingKeys = const [],
})

Implementation

static List<int> generateUniqueRandom({
  int length = 32,
  List<List<int>> existingKeys = const [],
}) {
  List<int> rand = generateRandom(length);
  if (existingKeys.isEmpty) return rand;
  while (BytesUtils.isContains(existingKeys, rand)) {
    rand = QuickCrypto.generateRandom(length);
  }
  return rand;
}