Last active
February 5, 2023 03:19
-
-
Save Codezigineer/51dd2dea1626c5af82addac4b62a9f00 to your computer and use it in GitHub Desktop.
Cryptorand.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
unsigned char clz32(unsigned int x) | |
{ | |
return __builtin_clz(x); | |
}; | |
unsigned char *randomData(unsigned length) | |
{ | |
unsigned char *array = (unsigned char *)malloc(length); | |
unsigned i = length; | |
while(i--) | |
{ | |
unsigned int num = ((unsigned int)random() * 16777216) >>> 0; | |
num = num + (num % 16777213); | |
array[i] = ((((((unsigned int)random() * 16777216) % num)) * 8) >>> 0) % ((unsigned int)random() * 256) ^ clz32((unsigned int)random() * 256) ^ i; | |
}; | |
return array; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment