PCGRandom constructor

PCGRandom([
  1. int? initialState,
  2. int? initialSequence
])

Implementation

PCGRandom([int? initialState, int? initialSequence]) {
  initialState ??= _rand.nextInt(_max) + _rand.nextInt(_max) >> 32;
  initialSequence ??= _rand.nextInt(_max) + _rand.nextInt(_max) >> 32;
  if (initialSequence.isEven) {
    initialSequence = initialSequence ^ 1;
  }
  _seed(initialState, initialSequence);
}