createSeeded static method

SecureRandom createSeeded({
  1. int seedLength = 32,
})

Creates and seeds a SecureRandom instance

Implementation

static SecureRandom createSeeded({int seedLength = 32}) {
  final rnd = SecureRandom('AES/CTR/AUTO-SEED-PRNG');
  final seed = Uint8List.fromList(List.generate(
      seedLength, (_) => DateTime.now().microsecondsSinceEpoch % 256));
  rnd.seed(KeyParameter(seed));
  return rnd;
}