I have two numbers:
- IMEI Number : 12345678912345
- Random Pin : 654321
My Random pin changes always. Based on this combination (IMEI and PIN ) is there any way to generate a 6 digit random number?
I want to do it in C#.
I have two numbers:
My Random pin changes always. Based on this combination (IMEI and PIN ) is there any way to generate a 6 digit random number?
I want to do it in C#.
The most straightforward way is to seed the random number generator with a function of both numbers
Random r = new Random(IMEA+Pin);
int v = r.Next()%900000 + 100000;
in this example the function is just the sum but you can find something more senseful for sure.. it's just to give you the idea.
Fixed version of Jack's answer
int seed = unchecked((int)(imie+pin));
Random r = new Random(seed);
int[] result = new int[100];
for (int i = 0; i < 100; i++) {
result[i] = r.Next() % 900000 + 100000;
}
edit fixed answer as per the sudden revelation that you need 100 numbers