Crate captcha_rs

source ·
Expand description

Generate a verification image.

use captcha_rs::{CaptchaBuilder};

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);
let base_img = captcha.to_base64();
println!("base_img: {}", base_img);

Structs