8 releases

0.1.7 Nov 8, 2024
0.1.6 Oct 22, 2024
0.1.5 May 31, 2024
0.1.4 Nov 28, 2023
0.1.0 Aug 28, 2023

#284 in Images

Download history 2/week @ 2024-09-18 9/week @ 2024-09-25 2/week @ 2024-10-02 91/week @ 2024-10-16 59/week @ 2024-10-23 5/week @ 2024-10-30 118/week @ 2024-11-06 8/week @ 2024-11-13 6/week @ 2024-11-20 6/week @ 2024-12-04 11/week @ 2024-12-11 9/week @ 2024-12-18 22/week @ 2024-12-25 37/week @ 2025-01-01

81 downloads per month

MPL-2.0 license

32KB
413 lines

BioSvg

Captcha based on SVG.

Original idea

SVG绘制原理与验证码

Usage

cargo add biosvg

let (answer, svg) = BiosvgBuilder::new()
    .length(4)
    .difficulty(6)
    .colors(vec![
        "#0078D6".to_string(),
        "#aa3333".to_string(),
        "#f08012".to_string(),
        "#33aa00".to_string(),
        "#aa33aa".to_string(),
    ])
    .build()
    .unwrap();
println!("answer: {}", answer);
println!("svg: {}", svg);

Example

ncuz wxgc


lib.rs:

Captcha based on SVG.

Original idea

SVG绘制原理与验证码

Usage

cargo add biosvg

let (answer, svg) = BiosvgBuilder::new()
    .length(4)
    .difficulty(6)
    .colors(vec![
        "#0078D6".to_string(),
        "#aa3333".to_string(),
        "#f08012".to_string(),
        "#33aa00".to_string(),
        "#aa33aa".to_string(),
    ])
    .build()
    .unwrap();
println!("answer: {}", answer);
println!("svg: {}", svg);

Dependencies

~2.7–4MB
~76K SLoC