Skip to content
forked from daniel-e/captcha

CAPTCHA library written in Rust.

License

Notifications You must be signed in to change notification settings

paulzhng/captcha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAPTCHA library written in Rust

Build Status

A library to generate CAPTCHAs like these:

captcha   captcha   captcha

Requirements

Rust (https://www.rust-lang.org/)

Documentation

https://docs.rs/captcha

Usage

Add the following dependency to the Cargo.toml file:

[dependencies]
captcha = "*"

In your source file do:

extern crate captcha;

use captcha::Captcha;
use captcha::filters::Noise;
use std::path::Path;

fn main() {
    Captcha::new()
        .add_chars(5)
        .apply_filter(Noise::new(0.1))
        .view(220, 120)
        .save(Path::new("/tmp/captcha.png"))
        .expect("save failed");
}

Running the example

git clone [email protected]:daniel-e/captcha.git
cd captcha
cargo run --example captcha

This example creates the following three CAPTCHA images:

  • /tmp/captcha1.png
  • /tmp/captcha2.png
  • /tmp/captcha3.png

The generated images will look like the following three images:

captcha   captcha   captcha

About

CAPTCHA library written in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 94.7%
  • Python 4.2%
  • Other 1.1%