Add xorshift prng

This commit is contained in:
Abdelrahman Said
2025-03-16 22:34:56 +00:00
parent 70e075d2f6
commit d661312cfa
6 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#ifndef XORSHIFT_H
#define XORSHIFT_H
#include "../../common/aliases/aliases.h"
#ifdef __cplusplus
BEGIN_C_LINKAGE
#endif // __cplusplus
typedef struct xor_256_state XOR256State;
struct xor_256_state {
u64 x;
u64 y;
u64 z;
u64 w;
};
XOR256State wapp_init_xor_256_state(void);
u64 wapp_xorshift_256_generate(XOR256State *state);
u64 wapp_xoshiro_256ss_generate(XOR256State *state);
u64 wapp_xoshiro_256p_generate(XOR256State *state);
#ifdef __cplusplus
END_C_LINKAGE
#endif // __cplusplus
#endif // !XORSHIFT_H