| Crates.io | captcha-rs |
| lib.rs | captcha-rs |
| version | 0.2.11 |
| created_at | 2022-03-01 20:51:35.890358+00 |
| updated_at | 2025-01-10 08:08:58.611851+00 |
| description | Generate verification images dynamically |
| homepage | https://github.com/samirdjelal/captcha-rs |
| repository | https://github.com/samirdjelal/captcha-rs |
| max_upload_size | |
| id | 541812 |
| size | 320,577 |
captcha-rs is a library that generate verification images dynamically.
Example pictures are as follows:
![]() |
![]() |
![]() |
|---|---|---|
![]() |
![]() |
![]() |
| Complexity | Light Mode / Noise Filter | Dark Mode / Noise Filter |
|---|---|---|
| Level 1 | ![]() |
![]() |
| Level 2 | ![]() |
![]() |
| Level 3 | ![]() |
![]() |
| Level 4 | ![]() |
![]() |
| Level 5 | ![]() |
![]() |
| Level 6 | ![]() |
![]() |
| Level 7 | ![]() |
![]() |
| Level 8 | ![]() |
![]() |
| Level 9 | ![]() |
![]() |
| Level 10 | ![]() |
![]() |
Add the following dependency to the Cargo.toml file:
[dependencies]
captcha-rs = "0.2.11"
And then get started in your main.rs:
use captcha_rs::CaptchaBuilder;
fn main() {
let captcha = CaptchaBuilder::new()
.length(5)
.width(130)
.height(40)
.dark_mode(false)
.complexity(1) // min: 1, max: 10
.compression(40) // min: 1, max: 99
.build();
println!("text: {}", captcha.text);
println!("base_img: {}", captcha.to_base64());
}
# Dev
💲 cargo run
# Build
💲 cargo build
# Test
💲 cargo test -- --nocapture
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in captcha-rs by you, shall be licensed as MIT, without any additional terms or conditions.