MCPcopy Create free account
hub / github.com/JeanLucPons/VanitySearch / rk_seed

Function rk_seed

Random.cpp:34–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#define RK_MAX 0xFFFFFFFFUL
33
34void rk_seed(unsigned long seed, rk_state *state)
35{
36 int pos;
37 seed &= 0xffffffffUL;
38
39 /* Knuth's PRNG as used in the Mersenne Twister reference implementation */
40 for (pos=0; pos<RK_STATE_LEN; pos++)
41 {
42 state->key[pos] = seed;
43 seed = (1812433253UL * (seed ^ (seed >> 30)) + pos + 1) & 0xffffffffUL;
44 }
45
46 state->pos = RK_STATE_LEN;
47}
48
49/* Magic Mersenne Twister constants */
50#define N 624

Callers 1

rseedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected