summaryrefslogtreecommitdiff
path: root/xorshift.h
diff options
context:
space:
mode:
Diffstat (limited to 'xorshift.h')
-rw-r--r--xorshift.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/xorshift.h b/xorshift.h
new file mode 100644
index 0000000..64c3ea2
--- /dev/null
+++ b/xorshift.h
@@ -0,0 +1,14 @@
+#pragma once
+
+#include <stdint.h>
+
+#define XORSHIFT_S 16
+
+typedef struct {
+ uint64_t s[XORSHIFT_S];
+ int p;
+} randctx;
+
+uint64_t xorshift_step (randctx * const st);
+void xorshift_seed (randctx * const st);
+