We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38b25a0 commit 7e3065bCopy full SHA for 7e3065b
DCC-Miner/DCC-Miner/randEngine.c
@@ -50,6 +50,17 @@ static int stdlib_rand_bytes(unsigned char* buf, int num)
50
return 1;
51
}
52
53
+// Fill the buffer with random numbers 0-9. For each byte in the buffer, we generate
54
+// a random number and clamp it to the range 0-9.
55
+static int stdlib_rand_numeric_string(unsigned char* buf, int num)
56
+{
57
+ for (int index = 0; index < num; ++index)
58
+ {
59
+ buf[index] = (rand() % 10) + '0';
60
+ }
61
+ return 1;
62
+}
63
+
64
// Create the table that will link OpenSSL's rand API to our functions.
65
static RAND_METHOD stdlib_rand_meth = {
66
stdlib_rand_seed,
@@ -95,4 +106,4 @@ void createRSAKey() {
95
106
// Clear memory
96
107
BN_free(bn);
97
108
RSA_free(rsa);
98
-}
109
0 commit comments