pow-captcha-core

Crates.iopow-captcha-core
lib.rspow-captcha-core
version0.2.2
created_at2025-08-20 15:30:49.123733+00
updated_at2025-08-20 15:35:44.435622+00
descriptionA simple, lightweight, and dependency-free Proof-of-Work (PoW) CAPTCHA library.
homepage
repositoryhttps://github.com/FairyLightsStudio/PoWCAPTCHA/blob/main/pow-captcha-core
max_upload_size
id1803599
size13,518
voyage200🍬 (jexjws)

documentation

README

PoW Captcha Core

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.

Features

  • Generate PoW challenges with a specified difficulty.
  • Verify solutions provided by clients.
  • Solve challenges (intended for client-side use).
  • Supports SHA-256 and SHA-512 hashing algorithms.

Usage

Add the dependency:

cargo add pow-captcha-core

Example

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));

License

This project is licensed to you under the MIT License.

RoadMap

  • Explore the possibility of adding RandomX algorithm support for stronger anti-ASIC properties
Commit count: 0

cargo fmt