| 146 | |
| 147 | |
| 148 | long Rand32() |
| 149 | { |
| 150 | PrimeRandoms(); |
| 151 | |
| 152 | randomRead++; |
| 153 | if (randomRead >= RANDOMS_COUNT) { |
| 154 | randomRead = 0; |
| 155 | } |
| 156 | |
| 157 | long result = randoms[randomRead]; |
| 158 | |
| 159 | // TODO: make a better hasher |
| 160 | #ifdef MACOS |
| 161 | randoms[randomRead] ^= Random(); |
| 162 | #else |
| 163 | int r = rand() ^ (rand() << 8); |
| 164 | randoms[randomRead] ^= r; |
| 165 | #endif |
| 166 | |
| 167 | return result; |
| 168 | } |
| 169 | |
| 170 | |
| 171 | long Rand16() |
no test coverage detected