secureRandom method
Implementation
SecureRandom secureRandom() {
// Create a new `SecureRandom` for every 500 usages
// to avoid random period exhaustion:
if (_secureRandomUseCount > 500 &&
_secureRandomUseCount > 500 + _securePeriodRandom.nextInt(1000)) {
resetSecureRandom();
}
var random = _secureRandom ??= SecureRandom();
++_secureRandomUseCount;
return random;
}