Skip to content

Instantly share code, notes, and snippets.

@dvv
Created March 20, 2018 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvv/764385041f09c625e01671cbdb798f17 to your computer and use it in GitHub Desktop.
Save dvv/764385041f09c625e01671cbdb798f17 to your computer and use it in GitHub Desktop.
c random uint32_t generator
uint32_t _rand(void)
{
static uint32_t Z;
if (Z & 1) {
Z = (Z >> 1);
} else {
Z = (Z >> 1) ^ 0x7FFFF159;
}
return Z;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment