From 18496a371a2204e8c1b448921a87108f4aa7ada3 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Sat, 23 Jan 2021 18:20:05 -0500 Subject: Attempting Zobrist hashing --- include/xorshift64.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/xorshift64.h (limited to 'include/xorshift64.h') 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 + +#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 -- cgit v1.2.3