| Crates.io | pow-captcha-core |
| lib.rs | pow-captcha-core |
| version | 0.2.2 |
| created_at | 2025-08-20 15:30:49.123733+00 |
| updated_at | 2025-08-20 15:35:44.435622+00 |
| description | A simple, lightweight, and dependency-free Proof-of-Work (PoW) CAPTCHA library. |
| homepage | |
| repository | https://github.com/FairyLightsStudio/PoWCAPTCHA/blob/main/pow-captcha-core |
| max_upload_size | |
| id | 1803599 |
| size | 13,518 |
pow-captcha-core is a simple, lightweight, and dependency-free Proof-of-Work (PoW) CAPTCHA library for Rust. It provides the core logic for generating and verifying PoW challenges.
Add the dependency:
cargo add pow-captcha-core
use pow_captcha_core::{generate_challenge, solve_challenge, verify_solution, HashAlgorithm};
// 1. Server: Generate a challenge
let challenge = generate_challenge(Some(4), Some(HashAlgorithm::Sha256));
// 2. Client: Solve the challenge
let solution = solve_challenge(&challenge);
// 3. Server: Verify the solution
assert!(verify_solution(&challenge, &solution));
This project is licensed to you under the MIT License.