Skip to content

Commit be94409

Browse files
committed
🎉 v0.1.0
0 parents  commit be94409

File tree

9 files changed

+726
-0
lines changed

9 files changed

+726
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/target
2+
3+
4+
# Added by cargo
5+
#
6+
# already existing elements were commented out
7+
8+
#/target
9+
/Cargo.lock

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"svg.preview.background": "black"
3+
}

Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "biosvg"
3+
version = "0.1.0"
4+
edition = "2021"
5+
authors = ["Reverier-Xu <[email protected]>"]
6+
description = "Captcha based on SVG."
7+
homepage = "https://github.com/XDSEC/biosvg"
8+
documentation = "https://docs.rs/biosvg"
9+
repository = "https://github.com/XDSEC/biosvg"
10+
readme = "README.md"
11+
license = "MPL-2.0"
12+
13+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
14+
15+
[dependencies]
16+
once_cell = "1.18"
17+
rand = "0.8"
18+
regex = "1.9"
19+
thiserror = "1.0"

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# BioSvg
2+
3+
Captcha based on SVG.
4+
5+
## Original idea
6+
7+
[SVG绘制原理与验证码](https://blog.woooo.tech/posts/svg_1/)
8+
9+
## Usage
10+
11+
`cargo add biosvg`
12+
13+
```rust
14+
let (answer, svg) = BiosvgBuilder::new()
15+
.length(4)
16+
.difficulty(6)
17+
.colors(vec![
18+
"#0078D6".to_string(),
19+
"#aa3333".to_string(),
20+
"#f08012".to_string(),
21+
"#33aa00".to_string(),
22+
"#aa33aa".to_string(),
23+
])
24+
.build()
25+
.unwrap();
26+
println!("answer: {}", answer);
27+
println!("svg: {}", svg);
28+
```
29+
30+
## Example
31+
32+
![ncuz](samples/ncuz.svg)
33+
![wxgc](samples/wxgc.svg)

samples/ncuz.svg

Lines changed: 77 additions & 0 deletions
Loading

samples/wxgc.svg

Lines changed: 95 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)