diff options
| author | tslil clingman <tslil@posteo.de> | 2021-01-23 18:20:05 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2021-01-23 18:20:05 -0500 |
| commit | 50678edd7ed39049902bedeb57c8044c7375e126 (patch) | |
| tree | a2a0882c46882f40cd00906e59f52a0a0118a794 /include/xorshift64.h | |
| parent | b1cba049ddb41f9b864412d038fc138014f97c3c (diff) | |
Attempting Zobrist hashing
Diffstat (limited to 'include/xorshift64.h')
| -rw-r--r-- | include/xorshift64.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/xorshift64.h b/include/xorshift64.h new file mode 100644 index 0000000..a12a38d --- /dev/null +++ b/include/xorshift64.h @@ -0,0 +1,18 @@ +#include <stdint.h> + +#ifndef XORSHIFT_H +#define XORSHIFT_H + +extern uint64_t xors; + +#define XORSHIFT { \ + xors ^= xors >> 12; \ + xors ^= xors << 25; \ + xors ^= xors >> 27; \ + xors *= 0x2545F4914F6CDD1D; \ + } + +#define RANDOM64 (xors) +#define RANDOM32 ((uint32_t)xors) + +#endif |
