Skip to content
/ captcha Public

NIF bindings for the captcha Rust implementation

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.md
Notifications You must be signed in to change notification settings

feng19/captcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Captcha

Module Version Hex Docs Total Download License Last Updated

NIF bindings for the captcha Rust implementation

Installation

The package can be installed by adding captcha to your list of dependencies in mix.exs:

def deps do
  [
    {:captcha, "~> 0.1", hex: :captcha_nif}
  ]
end

Documentation can be found at https://hexdocs.pm/captcha_nif.

Rust Documentation can be found at https://docs.rs/captcha/latest/captcha.

Usage

Crate to generate CAPTCHAs.

Easy example:

iex> {chars, png} = Captcha.easy()
{"SnZw8", <<...>>}
iex> File.write!("captcha.png", png)
:ok

Or create by custom chars:

iex> Captcha.easy(set_color: %{r: 0, g: 116, b: 204})
{"SnZw8", <<...>>}

Create by options:

iex> Captcha.create(
...>   set_chars: "123456789abcdefgABCDEFG",
...>   add_chars: 6,
...>   set_color: %{r: 0, g: 116, b: 204},
...>   view: %{w: 220, h: 120},
...>   filters: [filter, ...]
...> )
{"78a23G", <<...>>}

More use case can see: test/captcha_test.exs or rust docs.

About

NIF bindings for the captcha Rust implementation

Resources

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published