gomcaptcha/mcaptcha-pow-ffi/mcaptcha_pow_ffi.h
Aravinth Manivannan 35bc3ceee0
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat: reuse init
2024-01-08 05:05:31 +05:30

18 lines
567 B
C

// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
//
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#include <stdbool.h>
struct ProofOfWork {
unsigned long int nonce;
char *result;
};
bool is_valid_proof(unsigned long int nonce, char *result, char *phrase,
char *salt);
bool is_sufficient_difficulty(unsigned long int nonce, char *result, char *salt,
unsigned difficulty);
struct ProofOfWork prove_work(char *salt, char *phrase, unsigned difficulty);