public override void SetSeed(ulong[] seed) { // Don't allow all zero values with this generator. if (seed == null || CleromUtil.IsArrayZero(seed)) { SetStartingState(); // Important to reset base cache ResetCache(); } else if (seed.Length > 0) { if (seed.Length == 1) { SetStartingState(); state0 = seed[0]; } else { state0 = seed[0]; state1 = seed[1]; } ResetCache(); } }
public override void SetSeed(ulong[] seed) { // Don't allow all zero values with this generator. if (seed == null || CleromUtil.IsArrayZero(seed)) { SetStartingState(); // Important to reset base cache ResetCache(); } else if (seed.Length > 0) { if (seed.Length < StateSize) { SetStartingState(); Buffer.BlockCopy(seed, 0, state, 0, seed.Length * sizeof(ulong)); } else { Buffer.BlockCopy(seed, 0, state, 0, StateSize * sizeof(ulong)); } stateIdx = 0; ResetCache(); } }