Random with seed work not correct

var r1 = new Random(myUniqueId.GetHashCode());
var r2 = new Random(myUniqueId.GetHashCode());

r1 is not equal to r2

can you test (random seed should not be the same if re-generated each of them)

var r1 = new Random(myUniqueId.GetHashCode());
Thread.Sleep(100);
var r2 = new Random(myUniqueId.GetHashCode());

did do same results

We use hardware made true random number generator. The numbers will never match.

Can you return a pseudo random generator?
So that there is a choice of pseudo random or a hardware generator

Why? We need a solid case.

Firstly you need it for AutoIP (https://tools.ietf.org/html/rfc3927#section-2.1 third paragraph).
Secondly, we need it for the mac address generation function.

understood
in that case it raise the question whats the sense to initialize Random with your own option?

I still do not understand why you need a random number but then you need the random number to be “not random”

1 Like

i think our both questions are valid :wink:

Leave the opportunity for users to choose how to generate a random number

Yes. I don’t understand this either

whats the use case behind? how is this kind of a random number better or different compared to a random number?

could it be the case you want, beside a random number generator (RNG) a pseudo random number generator (PRNG) ?
Pseudorandom number generator

It is “random number”. This means the number is random. You are complaining that the random number is not random and we need to understand why. If you need a simple randomizer (sequencer), you can easily implement one in C#.

I just googled it and this is the first thing that came back

a = 16807;
m = 2147483647;
seed = (a * seed) mod m;
random = seed / m;