Skip to main content

ancaptcha/
lib.rs

1//! anCaptcha: A No-JS, stateless captcha engine implemented in Rust for cross-language integration.
2//!
3//! Originally designed for the darknet, specifically for Tor hidden services, to provide human 
4//! verification without requiring JavaScript. It uses authenticated encryption (ChaCha20-Poly1305) 
5//! to store challenge state in tokens, eliminating the need for server-side sessions.
6//!
7//! (c) 2026 Maverick. Licensed under Apache License, Version 2.0.
8#![forbid(unsafe_code)]
9#![warn(
10    clippy::unwrap_used,
11    clippy::expect_used,
12    clippy::panic,
13    clippy::indexing_slicing
14)]
15
16pub mod common;
17pub mod config;
18pub mod crypto;
19pub mod engine;
20pub mod storage;
21pub mod styles;
22pub mod verification;
23
24pub use common::assets;
25pub use common::error::{AnCaptchaError, Result};
26pub use config::{CaptchaStyle, Config, Difficulty, Layout, NoiseIntensity, Theme};
27pub use crypto::token::DEFAULT_TTL_SECONDS;
28pub use engine::{CaptchaRequest, generate_full_captcha};
29pub use storage::{AssetCache, get_cache, init_cache, init_with_intensity};
30pub use verification::{
31    AnCaptcha, CaptchaBundle, PairSubmission, RotateSubmission, SliderSubmission,
32    generate_pair_bundle, generate_rotate_bundle, generate_slider_bundle, verify_pair,
33    verify_rotate, verify_slider,
34};