Fixed API examples

This commit is contained in:
tevador
2019-05-03 16:50:05 +02:00
parent 1037cc0139
commit cb3d57376f
2 changed files with 10 additions and 5 deletions

View File

@@ -2,12 +2,12 @@
#include <stdio.h>
int main() {
const char mySeed[] = "RandomX example seed";
const char myKey[] = "RandomX example key";
const char myInput[] = "RandomX example input";
char hash[RANDOMX_HASH_SIZE];
randomx_cache *myCache = randomx_alloc_cache(RANDOMX_FLAG_DEFAULT);
randomx_init_cache(myCache, mySeed, sizeof mySeed);
randomx_init_cache(myCache, &myKey, sizeof myKey);
randomx_vm *myMachine = randomx_create_vm(RANDOMX_FLAG_DEFAULT, myCache, NULL);
randomx_calculate_hash(myMachine, &myInput, sizeof myInput, hash);