Windows msvcrt.dll rand()
Usage
For random numbers generated using rand() from Windows API.
- Visual Studio C / C++
- MinGW gcc / g++
Generator
Seed:
Cracker
Last 2 outputs:
Seed Range
Unsigned Integer (32-bit)
Seed Size: 31 bits
Default Seed: 1
Definition
LCG
X
0 = Seed
X
n+1 = (214013 X
n + 2531011) mod 2147483648
Initial Output: X
1
Output: X >> 16
Range: 0 ~ 32767
Sample Code for 100 Values (C):
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
if (argc >= 2) {
srand(atoi(argv[1]));
}
int i;
for (i = 0; i < 100; ++i){
printf("%d ", rand());
};
return 0;
}