Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 2 months 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-08T17:55:53.000Z (3 months ago)
- Last Synced: 2024-11-17T11:56:38.686Z (3 months ago)
- Topics: captcha, captcha-generator, rust, svg, web
- Language: Rust
- Homepage: https://crates.io/crates/biosvg
- Size: 27.3 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
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
![ncuz](samples/ncuz.svg)
![wxgc](samples/wxgc.svg)