https://github.com/reverier-xu/biosvg
Captcha based on SVG.
https://github.com/reverier-xu/biosvg
captcha captcha-generator rust svg web
Last synced: about 1 year ago
JSON representation
Captcha based on SVG.
- Host: GitHub
- URL: https://github.com/reverier-xu/biosvg
- Owner: Reverier-Xu
- License: mpl-2.0
- Created: 2023-08-28T09:56:02.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-04T19:57:57.000Z (about 1 year ago)
- Last Synced: 2025-05-09T01:07:24.486Z (about 1 year ago)
- Topics: captcha, captcha-generator, rust, svg, web
- Language: Rust
- Homepage: https://crates.io/crates/biosvg
- Size: 38.1 KB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BioSvg
Captcha based on SVG.
## Original idea
[SVG绘制原理与验证码](https://blog.woooo.tech/posts/svg_1/)
## Usage
`cargo add biosvg`
```rust
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

